forked from OSchip/llvm-project
Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the LValue as the QualType in the LValue. No functionality change intended.
llvm-svn: 283795
This commit is contained in:
parent
4765c01981
commit
6fdfaedd9d
|
@ -90,7 +90,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
|
||||||
unsigned CVRQualifiers,
|
unsigned CVRQualifiers,
|
||||||
llvm::Value *Offset) {
|
llvm::Value *Offset) {
|
||||||
// Compute (type*) ( (char *) BaseValue + Offset)
|
// Compute (type*) ( (char *) BaseValue + Offset)
|
||||||
QualType IvarTy = Ivar->getType();
|
QualType IvarTy = Ivar->getType().withCVRQualifiers(CVRQualifiers);
|
||||||
llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
|
llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
|
||||||
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy);
|
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy);
|
||||||
V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
|
V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
|
||||||
|
@ -98,7 +98,6 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
|
||||||
if (!Ivar->isBitField()) {
|
if (!Ivar->isBitField()) {
|
||||||
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
|
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
|
||||||
LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy);
|
LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy);
|
||||||
LV.getQuals().addCVRQualifiers(CVRQualifiers);
|
|
||||||
return LV;
|
return LV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,9 +138,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
|
||||||
Addr = CGF.Builder.CreateElementBitCast(Addr,
|
Addr = CGF.Builder.CreateElementBitCast(Addr,
|
||||||
llvm::Type::getIntNTy(CGF.getLLVMContext(),
|
llvm::Type::getIntNTy(CGF.getLLVMContext(),
|
||||||
Info->StorageSize));
|
Info->StorageSize));
|
||||||
return LValue::MakeBitfield(Addr, *Info,
|
return LValue::MakeBitfield(Addr, *Info, IvarTy, AlignmentSource::Decl);
|
||||||
IvarTy.withCVRQualifiers(CVRQualifiers),
|
|
||||||
AlignmentSource::Decl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
Loading…
Reference in New Issue