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/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 32a1e38..eb9703e 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -623,7 +623,7 @@
     break;
   case pch::DECL_FUNCTION:
     D = FunctionDecl::Create(*Context, 0, SourceLocation(), DeclarationName(), 
-                             QualType());
+                             QualType(), 0);
     break;
   case pch::DECL_OBJC_METHOD:
     D = ObjCMethodDecl::Create(*Context, SourceLocation(), SourceLocation(), 
@@ -633,7 +633,7 @@
     D = ObjCInterfaceDecl::Create(*Context, 0, SourceLocation(), 0);
     break;
   case pch::DECL_OBJC_IVAR:
-    D = ObjCIvarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(),
+    D = ObjCIvarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
                              ObjCIvarDecl::None);
     break;
   case pch::DECL_OBJC_PROTOCOL:
@@ -670,11 +670,11 @@
                                      ObjCPropertyImplDecl::Dynamic, 0);
     break;
   case pch::DECL_FIELD:
-    D = FieldDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0, 
+    D = FieldDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0, 0, 
                           false, SourceLocation());
     break;
   case pch::DECL_VAR:
-    D = VarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(),
+    D = VarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
                         VarDecl::None, SourceLocation());
     break;
 
@@ -683,12 +683,12 @@
     break;
 
   case pch::DECL_PARM_VAR:
-    D = ParmVarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 
+    D = ParmVarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0, 
                             VarDecl::None, 0);
     break;
   case pch::DECL_ORIGINAL_PARM_VAR:
     D = OriginalParmVarDecl::Create(*Context, 0, SourceLocation(), 0,
-                                    QualType(), QualType(), VarDecl::None, 0);
+                                    QualType(),0, QualType(), VarDecl::None, 0);
     break;
   case pch::DECL_FILE_SCOPE_ASM:
     D = FileScopeAsmDecl::Create(*Context, 0, SourceLocation(), 0);
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 1d9f0fa..72982d2 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -1945,7 +1945,7 @@
                                                    false /*isVariadic*/, 0);
   SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                            SourceLocation(), 
-                                           SelGetUidIdent, getFuncType,
+                                           SelGetUidIdent, getFuncType, 0,
                                            FunctionDecl::Extern, false);
 }
 
@@ -1974,7 +1974,7 @@
                                                   false, 0);
   SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                          SourceLocation(), 
-                                         msgSendIdent, msgSendType,
+                                         msgSendIdent, msgSendType, 0,
                                          FunctionDecl::Extern, false);
 }
 
@@ -1993,7 +1993,7 @@
                                                   true /*isVariadic*/, 0);
   MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                          SourceLocation(),
-                                         msgSendIdent, msgSendType,
+                                         msgSendIdent, msgSendType, 0,
                                          FunctionDecl::Extern, false);
 }
 
@@ -2015,7 +2015,7 @@
                                                   true /*isVariadic*/, 0);
   MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                               SourceLocation(), 
-                                              msgSendIdent, msgSendType,
+                                              msgSendIdent, msgSendType, 0,
                                               FunctionDecl::Extern, false);
 }
 
@@ -2034,7 +2034,7 @@
                                                   true /*isVariadic*/, 0);
   MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                          SourceLocation(), 
-                                         msgSendIdent, msgSendType,
+                                         msgSendIdent, msgSendType, 0,
                                          FunctionDecl::Extern, false);
 }
 
@@ -2058,7 +2058,7 @@
                                                   true /*isVariadic*/, 0);
   MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                                        SourceLocation(), 
-                                              msgSendIdent, msgSendType,
+                                              msgSendIdent, msgSendType, 0,
                                               FunctionDecl::Extern, false);
 }
 
@@ -2077,7 +2077,7 @@
                                                   true /*isVariadic*/, 0);
   MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                               SourceLocation(), 
-                                              msgSendIdent, msgSendType,
+                                              msgSendIdent, msgSendType, 0,
                                               FunctionDecl::Extern, false);
 }
 
@@ -2092,7 +2092,7 @@
                                                    false /*isVariadic*/, 0);
   GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                           SourceLocation(), 
-                                          getClassIdent, getClassType,
+                                          getClassIdent, getClassType, 0,
                                           FunctionDecl::Extern, false);
 }
 
@@ -2107,7 +2107,7 @@
                                                    false /*isVariadic*/, 0);
   GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
                                               SourceLocation(), 
-                                              getClassIdent, getClassType,
+                                              getClassIdent, getClassType, 0,
                                               FunctionDecl::Extern, false);
 }
 
@@ -2142,7 +2142,7 @@
   Preamble += utostr(prettyBuf.str().size()-2) + "};\n";
   
   VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(), 
-                                    &Context->Idents.get(S.c_str()), strType, 
+                                    &Context->Idents.get(S.c_str()), strType, 0, 
                                     VarDecl::Static);
   DeclRefExpr *DRE = new (Context) DeclRefExpr(NewVD, strType, SourceLocation());
   Expr *Unop = new (Context) UnaryOperator(DRE, UnaryOperator::AddrOf,
@@ -2190,7 +2190,8 @@
     for (unsigned i = 0; i < 2; ++i) {
       SuperStructDecl->addDecl(FieldDecl::Create(*Context, SuperStructDecl, 
                                                  SourceLocation(), 0, 
-                                                 FieldTypes[i], /*BitWidth=*/0,
+                                                 FieldTypes[i], 0,
+                                                 /*BitWidth=*/0,
                                                  /*Mutable=*/false));
     }
   
@@ -2220,7 +2221,7 @@
       ConstantStringDecl->addDecl(FieldDecl::Create(*Context, 
                                                     ConstantStringDecl, 
                                                     SourceLocation(), 0,
-                                                    FieldTypes[i], 
+                                                    FieldTypes[i], 0,
                                                     /*BitWidth=*/0,
                                                     /*Mutable=*/true));
     }
@@ -2626,7 +2627,7 @@
   std::string Name = "_OBJC_PROTOCOL_" + Exp->getProtocol()->getNameAsString();
   IdentifierInfo *ID = &Context->Idents.get(Name);
   VarDecl *VD = VarDecl::Create(*Context, TUDecl, SourceLocation(), 
-                          ID, QualType()/*UNUSED*/, VarDecl::Extern);
+                          ID, QualType()/*UNUSED*/, 0, VarDecl::Extern);
   DeclRefExpr *DRE = new (Context) DeclRefExpr(VD, getProtocolType(), SourceLocation());
   Expr *DerefExpr = new (Context) UnaryOperator(DRE, UnaryOperator::AddrOf,
                              Context->getPointerType(DRE->getType()),
@@ -3962,7 +3963,7 @@
   //PE->dump();
   
   FieldDecl *FD = FieldDecl::Create(*Context, 0, SourceLocation(),
-                     &Context->Idents.get("FuncPtr"), Context->VoidPtrTy, 
+                     &Context->Idents.get("FuncPtr"), Context->VoidPtrTy, 0, 
                                     /*BitWidth=*/0, /*Mutable=*/true);
   MemberExpr *ME = new (Context) MemberExpr(PE, true, FD, SourceLocation(),
                                             FD->getType());
@@ -4194,7 +4195,7 @@
   IdentifierInfo *ID = &Context->Idents.get(name);
   QualType FType = Context->getFunctionNoProtoType(Context->VoidPtrTy);
   return FunctionDecl::Create(*Context, TUDecl,SourceLocation(), 
-                              ID, FType, FunctionDecl::Extern, false,
+                              ID, FType, 0, FunctionDecl::Extern, false,
                               false);
 }