Added vector to ASTContext to store references to "complete" VLA types
(VLAs with a specified size expresssion).  This vector owns the
references to these type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43502 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index ba8ee07..ee45c00 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -455,10 +455,10 @@
     // Since we don't unique expressions, it isn't possible to unique VLA's
     // that have an expression provided for their size.
     
-    ArrayType *New = new VariableArrayType(EltTy, QualType(), NumElts, 
-                                           ASM, EltTypeQuals);
+    VariableArrayType *New = new VariableArrayType(EltTy, QualType(), NumElts, 
+                                                   ASM, EltTypeQuals);
     
-    // FIXME: Also add non-uniqued VLAs into a list of their own.
+    CompleteVariableArrayTypes.push_back(New);
     Types.push_back(New);
     return QualType(New, 0);
   }
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 9adb35a..dda0490 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -36,6 +36,7 @@
   llvm::FoldingSet<ReferenceType> ReferenceTypes;
   llvm::FoldingSet<ConstantArrayType> ArrayTypes;
   llvm::FoldingSet<VariableArrayType> IncompleteVariableArrayTypes;
+  std::vector<VariableArrayType*> CompleteVariableArrayTypes;
   llvm::FoldingSet<VectorType> VectorTypes;
   llvm::FoldingSet<FunctionTypeNoProto> FunctionTypeNoProtos;
   llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos;
@@ -90,7 +91,7 @@
   ~ASTContext();
   
   void PrintStats() const;
-
+ 
   //===--------------------------------------------------------------------===//
   //                           Type Constructors
   //===--------------------------------------------------------------------===//