forked from OSchip/llvm-project
Make the ivar offset always be a ptrdiff_t, because stuff in CGObjC.cpp expects this. Actually, it expects a long, but that's a bug that will be fixed in the next commit...
llvm-svn: 128102
This commit is contained in:
parent
a5a779ef45
commit
6a566d2c1e
|
@ -2451,11 +2451,13 @@ llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
|
|||
const ObjCIvarDecl *Ivar) {
|
||||
if (CGM.getLangOptions().ObjCNonFragileABI) {
|
||||
Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
|
||||
return CGF.Builder.CreateLoad(CGF.Builder.CreateLoad(
|
||||
ObjCIvarOffsetVariable(Interface, Ivar), false, "ivar"));
|
||||
return CGF.Builder.CreateZExtOrBitCast(
|
||||
CGF.Builder.CreateLoad(CGF.Builder.CreateLoad(
|
||||
ObjCIvarOffsetVariable(Interface, Ivar), false, "ivar")),
|
||||
PtrDiffTy);
|
||||
}
|
||||
uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar);
|
||||
return llvm::ConstantInt::get(LongTy, Offset, "ivar");
|
||||
return llvm::ConstantInt::get(PtrDiffTy, Offset, "ivar");
|
||||
}
|
||||
|
||||
CodeGen::CGObjCRuntime *
|
||||
|
|
Loading…
Reference in New Issue