[cfe-commits] r72203 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Fariborz Jahanian fjahanian at apple.com
Wed May 20 18:03:45 PDT 2009


Author: fjahanian
Date: Wed May 20 20:03:45 2009
New Revision: 72203

URL: http://llvm.org/viewvc/llvm-project?rev=72203&view=rev
Log:
Minor refactoring. Uses an existing API to lookup a class method.

Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=72203&r1=72202&r2=72203&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed May 20 20:03:45 2009
@@ -1277,7 +1277,7 @@
 
   /// ImplementationIsNonLazy - Check whether the given category or
   /// class implementation is "non-lazy".
-  bool ImplementationIsNonLazy(const DeclContext *DC) const;
+  bool ImplementationIsNonLazy(const ObjCImplDecl *OD) const;
 
 public:
   CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm);
@@ -4328,16 +4328,8 @@
 }
 
 bool 
-CGObjCNonFragileABIMac::ImplementationIsNonLazy(const DeclContext *DC) const {
-  DeclContext::lookup_const_result res = 
-    DC->lookup(CGM.getContext(), GetNullarySelector("load"));
-
-  for (; res.first != res.second; ++res.first)
-    if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(*res.first))
-      if (OMD->isClassMethod())
-        return true;
-  
-  return false;
+CGObjCNonFragileABIMac::ImplementationIsNonLazy(const ObjCImplDecl *OD) const {
+  return OD->getClassMethod(CGM.getContext(), GetNullarySelector("load")) != 0;
 }
 
 void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCImplementationDecl *OID,





More information about the cfe-commits mailing list