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:
David Chisnall 2011-03-22 19:57:51 +00:00
parent a5a779ef45
commit 6a566d2c1e
1 changed files with 5 additions and 3 deletions

View File

@ -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 *