]> granicus.if.org Git - clang/commitdiff
Added vector to ASTContext to store references to "complete" VLA types
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Oct 2007 16:41:53 +0000 (16:41 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Oct 2007 16:41:53 +0000 (16:41 +0000)
(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

AST/ASTContext.cpp
include/clang/AST/ASTContext.h

index ba8ee077c5e409af01d77a5145453e4364655092..ee45c008315b86f1e8e330590fd6b77dca13570a 100644 (file)
@@ -455,10 +455,10 @@ QualType ASTContext::getVariableArrayType(QualType EltTy, Expr *NumElts,
     // 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);
   }
index 9adb35aca2dbf3357ca30e84540d24e8025c8e8f..dda0490f24ea36bcefc641b97d0d078f505a4ddf 100644 (file)
@@ -36,6 +36,7 @@ class ASTContext {
   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 @@ public:
   ~ASTContext();
   
   void PrintStats() const;
-
   //===--------------------------------------------------------------------===//
   //                           Type Constructors
   //===--------------------------------------------------------------------===//