aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-24 02:57:34 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-24 02:57:34 +0000
commit516ff43cc4e20b637335d3dfa5b197ca8faa09cb (patch)
treeb416aa0d00ad0c2dcb7b19b00c65d2ae4c03ac53 /lib/Sema/SemaDecl.cpp
parent7cabee5b18212bd3106aea8415b044b2b3b43518 (diff)
Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but also
updates name lookup so that we see through @compatibility_alias declarations to their underlying interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index e81e883272..63b006277c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -299,6 +299,18 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S) {
S->RemoveDecl(DeclPtrTy::make(*Redecl));
IdResolver.RemoveDecl(*Redecl);
}
+ } else if (isa<ObjCInterfaceDecl>(D)) {
+ // We're pushing an Objective-C interface into the current
+ // context. If there is already an alias declaration, remove it first.
+ for (IdentifierResolver::iterator
+ I = IdResolver.begin(D->getDeclName()), IEnd = IdResolver.end();
+ I != IEnd; ++I) {
+ if (isa<ObjCCompatibleAliasDecl>(*I)) {
+ S->RemoveDecl(DeclPtrTy::make(*I));
+ IdResolver.RemoveDecl(*I);
+ break;
+ }
+ }
}
IdResolver.AddDecl(D);