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...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index fc81781..e30f4b2 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -32,6 +32,7 @@
   class ASTConsumer;
   class Preprocessor;
   class Decl;
+  class NamedDecl;
   class ScopedDecl;
   class Expr;
   class InitListExpr;
@@ -51,6 +52,7 @@
   class OCUVectorType;
   class TypedefDecl;
   class ObjCInterfaceDecl;
+  class ObjCCompatibleAliasDecl;
   class ObjCProtocolDecl;
   class ObjCImplementationDecl;
   class ObjCCategoryImplDecl;
@@ -93,6 +95,13 @@
   /// find the declarations when needed.
   llvm::DenseMap<IdentifierInfo*, ObjCProtocolDecl*> ObjCProtocols;
   
+  /// ObjCAliasDecls - Keep track of all class declarations declared
+  /// with @compatibility_alias, so that we can emit errors on duplicates and
+  /// find the declarations when needed. This construct is ancient and will
+  /// likely never be seen. Nevertheless, it is here for compatibility.
+  typedef llvm::DenseMap<IdentifierInfo*, ObjCCompatibleAliasDecl*> ObjCAliasTy;
+  ObjCAliasTy ObjCAliasDecls;
+  
   // Enum values used by KnownFunctionIDs (see below).
   enum {
     id_printf,
@@ -232,16 +241,15 @@
   /// Subroutines of ActOnDeclarator().
   TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
                                 ScopedDecl *LastDecl);
-  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, ScopedDecl *Old);
-  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, ScopedDecl *Old);
-  VarDecl *MergeVarDecl(VarDecl *New, ScopedDecl *Old);
+  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
+  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
+  VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
 
   /// More parsing and symbol table subroutines...
   ParmVarDecl *ActOnParamDeclarator(struct DeclaratorChunk::ParamInfo &PI, 
                                     Scope *FnBodyScope);  
-  ScopedDecl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, 
-                               SourceLocation IdLoc, Scope *S);
-  ScopedDecl *LookupInterfaceDecl(IdentifierInfo *II);
+  Decl *LookupDecl(IdentifierInfo *II, unsigned NSI, 
+                   SourceLocation IdLoc, Scope *S);
   ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *Id);
   ScopedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
   ScopedDecl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,