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
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 46e20c9..167e337 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -146,7 +146,6 @@
                                       QualType ObjectTy,
                                       llvm::Value *BaseValue,
                                       const ObjCIvarDecl *Ivar,
-                                      const FieldDecl *Field,
                                       unsigned CVRQualifiers);
   virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
                                       ObjCInterfaceDecl *Interface,
@@ -1081,9 +1080,9 @@
                                        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);