[cfe-commits] r43502 - in /cfe/trunk: AST/ASTContext.cpp include/clang/AST/ASTContext.h

Ted Kremenek kremenek at apple.com
Tue Oct 30 09:41:54 PDT 2007


Author: kremenek
Date: Tue Oct 30 11:41:53 2007
New Revision: 43502

URL: http://llvm.org/viewvc/llvm-project?rev=43502&view=rev
Log:
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.

Modified:
    cfe/trunk/AST/ASTContext.cpp
    cfe/trunk/include/clang/AST/ASTContext.h

Modified: cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/ASTContext.cpp?rev=43502&r1=43501&r2=43502&view=diff

==============================================================================
--- cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/trunk/AST/ASTContext.cpp Tue Oct 30 11:41:53 2007
@@ -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);
   }

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=43502&r1=43501&r2=43502&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Tue Oct 30 11:41:53 2007
@@ -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
   //===--------------------------------------------------------------------===//





More information about the cfe-commits mailing list