Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit e5f62e8

Browse files
committed
Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the LValue as the QualType in the LValue. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283795 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8001a78 commit e5f62e8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/CodeGen/CGObjCRuntime.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,14 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
9090
unsigned CVRQualifiers,
9191
llvm::Value *Offset) {
9292
// Compute (type*) ( (char *) BaseValue + Offset)
93-
QualType IvarTy = Ivar->getType();
93+
QualType IvarTy = Ivar->getType().withCVRQualifiers(CVRQualifiers);
9494
llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
9595
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy);
9696
V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
9797

9898
if (!Ivar->isBitField()) {
9999
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
100100
LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy);
101-
LV.getQuals().addCVRQualifiers(CVRQualifiers);
102101
return LV;
103102
}
104103

@@ -139,9 +138,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
139138
Addr = CGF.Builder.CreateElementBitCast(Addr,
140139
llvm::Type::getIntNTy(CGF.getLLVMContext(),
141140
Info->StorageSize));
142-
return LValue::MakeBitfield(Addr, *Info,
143-
IvarTy.withCVRQualifiers(CVRQualifiers),
144-
AlignmentSource::Decl);
141+
return LValue::MakeBitfield(Addr, *Info, IvarTy, AlignmentSource::Decl);
145142
}
146143

147144
namespace {

0 commit comments

Comments
 (0)