diff options
author | Steve Naroff <snaroff@apple.com> | 2009-01-29 00:07:50 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-01-29 00:07:50 +0000 |
commit | 3e8ffd2e96e7842245f1ae0cb631eba75da1a6f7 (patch) | |
tree | fb9d3e0943df2ef7ce7d0927cfe4aedaf44bd69a /lib/Sema/SemaExprObjC.cpp | |
parent | 54f0728c2ab0f967e976300478b2f5cdfed78415 (diff) |
Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().
The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.
The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index eff259d8fa..a19a1d16d0 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -53,7 +53,7 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, // Initialize the constant string interface lazily. This assumes // the NSConstantString interface is seen in this translation unit. IdentifierInfo *NSIdent = &Context.Idents.get("NSConstantString"); - Decl *IFace = LookupDecl(NSIdent, Decl::IDNS_Ordinary, TUScope); + Decl *IFace = LookupDeclInScope(NSIdent, Decl::IDNS_Ordinary, TUScope); ObjCInterfaceDecl *strIFace = dyn_cast_or_null<ObjCInterfaceDecl>(IFace); if (strIFace) Context.setObjCConstantStringInterface(strIFace); @@ -210,7 +210,7 @@ Sema::ExprResult Sema::ActOnClassMessage( } else { // 'super' has been used outside a method context. If a variable named // 'super' has been declared, redirect. If not, produce a diagnostic. - Decl *SuperDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, S); + Decl *SuperDecl = LookupDeclInScope(receiverName, Decl::IDNS_Ordinary, S); ValueDecl *VD = dyn_cast_or_null<ValueDecl>(SuperDecl); if (VD) { ExprResult ReceiverExpr = new DeclRefExpr(VD, VD->getType(), @@ -235,7 +235,7 @@ Sema::ExprResult Sema::ActOnClassMessage( // // If necessary, the following lookup could move to getObjCInterfaceDecl(). if (!ClassDecl) { - Decl *IDecl = LookupDecl(receiverName, Decl::IDNS_Ordinary, 0); + Decl *IDecl = LookupDeclInScope(receiverName, Decl::IDNS_Ordinary, 0); if (TypedefDecl *OCTD = dyn_cast_or_null<TypedefDecl>(IDecl)) { const ObjCInterfaceType *OCIT; OCIT = OCTD->getUnderlyingType()->getAsObjCInterfaceType(); |