diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-10 19:02:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-10 19:02:04 +0000 |
commit | 21fc74c15a92ffb58264016da2a532e488cd6fb0 (patch) | |
tree | bdcadc76a34efe4cbfc74ac6674f69d2a19efc3e /clang/lib/CodeGen/CGExpr.cpp | |
parent | 1f517dd1c4855ffee1370ece9179f380437083e6 (diff) | |
download | bcm5719-llvm-21fc74c15a92ffb58264016da2a532e488cd6fb0.tar.gz bcm5719-llvm-21fc74c15a92ffb58264016da2a532e488cd6fb0.zip |
Some refactoring of Ivar offset code gen.
in preparation for nonfragile ivar offset work.
llvm-svn: 64225
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 96ded8ba1b8..f7bbb606a7b 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1025,17 +1025,7 @@ llvm::Value *CodeGenFunction::EmitIvarOffset(ObjCInterfaceDecl *Interface, // implement the lookup itself. if (CGM.getObjCRuntime().LateBoundIVars()) assert(0 && "late-bound ivars are unsupported"); - - const llvm::Type *InterfaceLTy = - CGM.getTypes().ConvertType(getContext().getObjCInterfaceType(Interface)); - const llvm::StructLayout *Layout = - CGM.getTargetData().getStructLayout(cast<llvm::StructType>(InterfaceLTy)); - FieldDecl *Field = Interface->lookupFieldDeclForIvar(getContext(), Ivar); - uint64_t Offset = - Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field)); - - return llvm::ConstantInt::get(CGM.getTypes().ConvertType(getContext().LongTy), - Offset); + return CGM.getObjCRuntime().EmitIvarOffset(*this, Interface, Ivar); } LValue CodeGenFunction::EmitLValueForIvar(QualType ObjectTy, |