aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-05-21 01:03:45 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-05-21 01:03:45 +0000
commitecfbdcbaf71609ab99cdebbf2d704173070dbaf3 (patch)
treed53ef52e9d814078182a45dd21aed8a19a432911
parent3433cf7dfda405bf51bba914a338adf645a87e3b (diff)
Minor refactoring. Uses an existing API to lookup a class method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72203 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGObjCMac.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 56ec99d7c7..8f1404da65 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/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,