summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-04-01 23:04:06 +0000
committerSteve Naroff <snaroff@apple.com>2008-04-01 23:04:06 +0000
commit257520b1b4c64381bd2216613b0f69b956438528 (patch)
treecd245193f399e6d8481fd3a0711a2b3451ff43bd /clang/lib/Sema/SemaExpr.cpp
parent94896e17bbd8af28aa301133635d80b55f0b7b01 (diff)
downloadbcm5719-llvm-257520b1b4c64381bd2216613b0f69b956438528.tar.gz
bcm5719-llvm-257520b1b4c64381bd2216613b0f69b956438528.zip
Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).
- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl. - Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's. - Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl(). - Some minor indentation changes. Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit... llvm-svn: 49058
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index c815b548689..94387da80f8 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -75,17 +75,18 @@ Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
IdentifierInfo &II,
bool HasTrailingLParen) {
// Could be enum-constant, value decl, instance variable, etc.
- ScopedDecl *D = LookupScopedDecl(&II, Decl::IDNS_Ordinary, Loc, S);
+ Decl *D = LookupDecl(&II, Decl::IDNS_Ordinary, Loc, S);
// If this reference is in an Objective-C method, then ivar lookup happens as
// well.
if (CurMethodDecl) {
+ ScopedDecl *SD = dyn_cast_or_null<ScopedDecl>(D);
// There are two cases to handle here. 1) scoped lookup could have failed,
// in which case we should look for an ivar. 2) scoped lookup could have
// found a decl, but that decl is outside the current method (i.e. a global
// variable). In these two cases, we do a lookup for an ivar with this
// name, if the lookup suceeds, we replace it our current decl.
- if (D == 0 || D->isDefinedOutsideFunctionOrMethod()) {
+ if (SD == 0 || SD->isDefinedOutsideFunctionOrMethod()) {
ObjCInterfaceDecl *IFace = CurMethodDecl->getClassInterface(), *DeclClass;
if (ObjCIvarDecl *IV = IFace->lookupInstanceVariable(&II, DeclClass)) {
// FIXME: This should use a new expr for a direct reference, don't turn
OpenPOWER on IntegriCloud