Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b216ec1..30d7b6a 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -119,8 +119,8 @@
   // Build the instantiated declaration
   VarDecl *Var = VarDecl::Create(SemaRef.Context, Owner,
                                  D->getLocation(), D->getIdentifier(),
-                                 T, D->getStorageClass(),
-                                 D->getTypeSpecStartLoc());
+                                 T, D->getDeclaratorInfo(),
+                                 D->getStorageClass(),D->getTypeSpecStartLoc());
   Var->setThreadSpecified(D->isThreadSpecified());
   Var->setCXXDirectInitializer(D->hasCXXDirectInitializer());
   Var->setDeclaredInCondition(D->isDeclaredInCondition());
@@ -199,6 +199,7 @@
   }
 
   FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(), T,
+                                            D->getDeclaratorInfo(),
                                             cast<RecordDecl>(Owner), 
                                             D->getLocation(),
                                             D->isMutable(),
@@ -380,13 +381,14 @@
 
     Function =
       FriendFunctionDecl::Create(SemaRef.Context, DC, D->getLocation(),
-                                 D->getDeclName(), T, D->isInline(),
-                                 FFD->getFriendLoc());
+                                 D->getDeclName(), T, D->getDeclaratorInfo(),
+                                 D->isInline(), FFD->getFriendLoc());
     Function->setLexicalDeclContext(Owner);
   } else {
     Function =
       FunctionDecl::Create(SemaRef.Context, Owner, D->getLocation(), 
-                           D->getDeclName(), T, D->getStorageClass(),
+                           D->getDeclName(), T, D->getDeclaratorInfo(),
+                           D->getStorageClass(),
                            D->isInline(), D->hasWrittenPrototype(),
                            D->getTypeSpecStartLoc());
   }
@@ -440,8 +442,8 @@
   CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
   CXXMethodDecl *Method
     = CXXMethodDecl::Create(SemaRef.Context, Record, D->getLocation(), 
-                            D->getDeclName(), T, D->isStatic(), 
-                            D->isInline());
+                            D->getDeclName(), T, D->getDeclaratorInfo(),
+                            D->isStatic(), D->isInline());
   Method->setInstantiationOfMemberFunction(D);
 
   // If we are instantiating a member function defined 
@@ -494,8 +496,8 @@
                                  SemaRef.Context.getCanonicalType(ClassTy));
   CXXConstructorDecl *Constructor
     = CXXConstructorDecl::Create(SemaRef.Context, Record, D->getLocation(), 
-                                 Name, T, D->isExplicit(), D->isInline(), 
-                                 false);
+                                 Name, T, D->getDeclaratorInfo(),
+                                 D->isExplicit(), D->isInline(), false);
   Constructor->setInstantiationOfMemberFunction(D);
 
   // Attach the parameters
@@ -576,7 +578,8 @@
     = CXXConversionDecl::Create(SemaRef.Context, Record,
                                 D->getLocation(),
          SemaRef.Context.DeclarationNames.getCXXConversionFunctionName(ConvTy),
-                                T, D->isInline(), D->isExplicit());
+                                T, D->getDeclaratorInfo(),
+                                D->isInline(), D->isExplicit());
   Conversion->setInstantiationOfMemberFunction(D);
   if (InitMethodInstantiation(Conversion, D))
     Conversion->setInvalidDecl();
@@ -612,12 +615,13 @@
   ParmVarDecl *Param = 0;
   if (T == OrigT)
     Param = ParmVarDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-                                D->getIdentifier(), T, D->getStorageClass(), 
-                                0);
+                                D->getIdentifier(), T, D->getDeclaratorInfo(),
+                                D->getStorageClass(), 0);
   else
     Param = OriginalParmVarDecl::Create(SemaRef.Context, Owner, 
                                         D->getLocation(), D->getIdentifier(),
-                                        T, OrigT, D->getStorageClass(), 0);
+                                        T, D->getDeclaratorInfo(), OrigT,
+                                        D->getStorageClass(), 0);
 
   // Note: we don't try to instantiate function parameters until after
   // we've instantiated the function's type. Therefore, we don't have