Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index c4fccc7..2653887 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -592,7 +592,7 @@
   
   ObjCImplementationDecl* IMPDecl = 
     ObjCImplementationDecl::Create(Context, CurContext, AtClassImplLoc, 
-                                   ClassName, IDecl, SDecl);
+                                   IDecl, SDecl);
   
   // FIXME: PushOnScopeChains?
   CurContext->addDecl(IMPDecl);
@@ -613,7 +613,7 @@
                                     ObjCIvarDecl **ivars, unsigned numIvars,
                                     SourceLocation RBrace) {
   assert(ImpDecl && "missing implementation decl");
-  ObjCInterfaceDecl* IDecl = getObjCInterfaceDecl(ImpDecl->getIdentifier());
+  ObjCInterfaceDecl* IDecl = ImpDecl->getClassInterface();
   if (!IDecl)
     return;
   /// Check case of non-existing @interface decl.
@@ -1143,7 +1143,7 @@
                                                   property->getIdentifier(),
                                                   property->getType(),
                                                   VarDecl::None,
-                                                  0, 0);
+                                                  0);
       SetterMethod->setMethodParams(&Argument, 1);
       CD->addDecl(SetterMethod);
     } else
@@ -1258,7 +1258,7 @@
   }
   if (ObjCImplementationDecl *IC=dyn_cast<ObjCImplementationDecl>(ClassDecl)) {
     IC->setLocEnd(AtEndLoc);
-    if (ObjCInterfaceDecl* IDecl = getObjCInterfaceDecl(IC->getIdentifier()))
+    if (ObjCInterfaceDecl* IDecl = IC->getClassInterface())
       ImplMethodsVsClassMethods(IC, IDecl);
   } else if (ObjCCategoryImplDecl* CatImplClass = 
                                    dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) {
@@ -1361,12 +1361,12 @@
       Param = ParmVarDecl::Create(Context, ObjCMethod,
                                   SourceLocation(/*FIXME*/),
                                   ArgNames[i], argType,
-                                  VarDecl::None, 0, 0);
+                                  VarDecl::None, 0);
     else
       Param = ParmVarWithOriginalTypeDecl::Create(Context, ObjCMethod,
                                   SourceLocation(/*FIXME*/),
                                   ArgNames[i], argType, originalArgType,
-                                  VarDecl::None, 0, 0);
+                                  VarDecl::None, 0);
     
     Param->setObjCDeclQualifier(
       CvtQTToAstBitMask(ArgQT[i].getObjCDeclQualifier()));
@@ -1544,7 +1544,7 @@
                                                         FD.D.getIdentifier(),
                                                         T,
                                                         VarDecl::None,
-                                                        0, 0);
+                                                        0);
             SetterDecl->setMethodParams(&Argument, 1);
             PIDecl->setSetterMethodDecl(SetterDecl);
           }
@@ -1634,7 +1634,7 @@
   ObjCImplementationDecl *IC = 0;
   ObjCCategoryImplDecl* CatImplClass = 0;
   if ((IC = dyn_cast<ObjCImplementationDecl>(ClassImpDecl))) {
-    IDecl = getObjCInterfaceDecl(IC->getIdentifier());
+    IDecl = IC->getClassInterface();
     // We always synthesize an interface for an implementation
     // without an interface decl. So, IDecl is always non-zero.
     assert(IDecl &&