Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 5097341..2997b21 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -812,7 +812,8 @@
                                                          Pad.getQuantity()),
                                                        ArrayType::Normal, 0);
     ValueDecl *PadDecl = VarDecl::Create(getContext(), 0, SourceLocation(),
-                                         0, QualType(PadTy), 0, VarDecl::None);
+                                         0, QualType(PadTy), 0,
+                                         VarDecl::None, VarDecl::None);
     Expr *E;
     E = new (getContext()) DeclRefExpr(PadDecl, PadDecl->getType(),
                                        SourceLocation());
@@ -860,7 +861,9 @@
   FunctionDecl *FD = FunctionDecl::Create(getContext(),
                                           getContext().getTranslationUnitDecl(),
                                           SourceLocation(), II, R, 0,
-                                          FunctionDecl::Static, false,
+                                          FunctionDecl::Static,
+                                          FunctionDecl::None,
+                                          false,
                                           true);
   CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
 
@@ -941,8 +944,9 @@
   FunctionDecl *FD = FunctionDecl::Create(getContext(),
                                           getContext().getTranslationUnitDecl(),
                                           SourceLocation(), II, R, 0,
-                                          FunctionDecl::Static, false,
-                                          true);
+                                          FunctionDecl::Static,
+                                          FunctionDecl::None,
+                                          false, true);
   CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
 
   if (NoteForHelperp) {
@@ -1025,8 +1029,9 @@
   FunctionDecl *FD = FunctionDecl::Create(getContext(),
                                           getContext().getTranslationUnitDecl(),
                                           SourceLocation(), II, R, 0,
-                                          FunctionDecl::Static, false,
-                                          true);
+                                          FunctionDecl::Static,
+                                          FunctionDecl::None,
+                                          false, true);
   CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
 
   // dst->x
@@ -1089,8 +1094,9 @@
   FunctionDecl *FD = FunctionDecl::Create(getContext(),
                                           getContext().getTranslationUnitDecl(),
                                           SourceLocation(), II, R, 0,
-                                          FunctionDecl::Static, false,
-                                          true);
+                                          FunctionDecl::Static,
+                                          FunctionDecl::None,
+                                          false, true);
   CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
 
   llvm::Value *V = CGF.GetAddrOfLocalVar(Src);