forked from OSchip/llvm-project
Access ivars with inbounds GEPs, even in -fwrapv. It's unlikely that
this can have any optimization effect, given the opacity of objects pointers, but you never know. llvm-svn: 126990
This commit is contained in:
parent
6647584951
commit
74186ab391
|
@ -115,7 +115,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
|
||||||
QualType IvarTy = Ivar->getType();
|
QualType IvarTy = Ivar->getType();
|
||||||
const llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
|
const llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
|
||||||
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, I8Ptr);
|
llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, I8Ptr);
|
||||||
V = CGF.Builder.CreateGEP(V, Offset, "add.ptr");
|
V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
|
||||||
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
|
V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
|
||||||
|
|
||||||
if (!Ivar->isBitField()) {
|
if (!Ivar->isBitField()) {
|
||||||
|
|
Loading…
Reference in New Issue