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...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Chisnall 2011-03-22 19:57:51 +00:00
Родитель c3e494047b
Коммит 7e02d1aebb
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

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