diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-21 01:03:45 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-21 01:03:45 +0000 |
| commit | a6bed8370e512d2fb5a41e5547336b05adf186bb (patch) | |
| tree | 0e7b1bbd43e301f1463af52e98d91b187876138a | |
| parent | 2ef7cae93b8e06a45029b645f7e9af7c1163ea8f (diff) | |
| download | bcm5719-llvm-a6bed8370e512d2fb5a41e5547336b05adf186bb.tar.gz bcm5719-llvm-a6bed8370e512d2fb5a41e5547336b05adf186bb.zip | |
Minor refactoring. Uses an existing API to lookup a class method.
llvm-svn: 72203
| -rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 56ec99d7c7d..8f1404da65d 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -1277,7 +1277,7 @@ private: /// 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 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassMetaData( } 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, |

