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
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index c30a7b2..f4014d1 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -201,12 +201,8 @@
   ObjCCompatibleAliasDecl *AliasDecl = 
     ObjCCompatibleAliasDecl::Create(Context, CurContext, AtLoc, AliasName, CDecl);
   
-  ObjCAliasDecls[AliasName] = AliasDecl;
-
-  // FIXME: PushOnScopeChains?
-  CurContext->addDecl(Context, AliasDecl);
   if (!CheckObjCDeclScope(AliasDecl))
-    TUScope->AddDecl(DeclPtrTy::make(AliasDecl));
+    PushOnScopeChains(AliasDecl, TUScope);
 
   return DeclPtrTy::make(AliasDecl);
 }