aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-21 01:19:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-21 01:19:28 +0000
commit525c9b7baeeff022127cd1b167579f3bda73b3ed (patch)
tree324b77cde1dbb39b094ef8dea9287f87bec8987f /lib/CodeGen/CGObjCMac.cpp
parente7d6c3de64009fb13c12f044b606e3d766faa082 (diff)
Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already doing! - No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 3b5e0c5504..58cfe8e163 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -701,7 +701,6 @@ private:
QualType ObjectTy,
llvm::Value *BaseValue,
const ObjCIvarDecl *Ivar,
- const FieldDecl *Field,
unsigned CVRQualifiers);
virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
ObjCInterfaceDecl *Interface,
@@ -891,7 +890,6 @@ public:
QualType ObjectTy,
llvm::Value *BaseValue,
const ObjCIvarDecl *Ivar,
- const FieldDecl *Field,
unsigned CVRQualifiers);
virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
ObjCInterfaceDecl *Interface,
@@ -2366,9 +2364,9 @@ LValue CGObjCMac::EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF,
QualType ObjectTy,
llvm::Value *BaseValue,
const ObjCIvarDecl *Ivar,
- const FieldDecl *Field,
unsigned CVRQualifiers) {
- assert(Field == ObjectTy->getAsObjCInterfaceType()->getDecl()->lookupFieldDeclForIvar(CGM.getContext(), Ivar));
+ const ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl();
+ const FieldDecl *Field = ID->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
if (Ivar->isBitField())
return CGF.EmitLValueForBitfield(BaseValue, const_cast<FieldDecl *>(Field),
CVRQualifiers);
@@ -4887,12 +4885,9 @@ LValue CGObjCNonFragileABIMac::EmitObjCValueForIvar(
QualType ObjectTy,
llvm::Value *BaseValue,
const ObjCIvarDecl *Ivar,
- const FieldDecl *Field,
unsigned CVRQualifiers) {
- assert(Field == ObjectTy->getAsObjCInterfaceType()->getDecl()->lookupFieldDeclForIvar(CGM.getContext(), Ivar));
- assert(ObjectTy->isObjCInterfaceType() &&
- "CGObjCNonFragileABIMac::EmitObjCValueForIvar");
- ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl();
+ const ObjCInterfaceDecl *ID = ObjectTy->getAsObjCInterfaceType()->getDecl();
+ const FieldDecl *Field = ID->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
llvm::GlobalVariable *IvarOffsetGV = ObjCIvarOffsetVariable(ID, Ivar);
// (char *) BaseValue