]> granicus.if.org Git - clang/commitdiff
Change two static variables into instance variables of ASTContext. This allows us...
authorTed Kremenek <kremenek@apple.com>
Fri, 18 Jun 2010 00:31:04 +0000 (00:31 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 18 Jun 2010 00:31:04 +0000 (00:31 +0000)
of ASTContext at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106258 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 2778d46dd2d9a1ee5cd130b354d187ddd0d37f80..e56752e8498442a09f7f20803db42232db5aa55c 100644 (file)
@@ -1345,6 +1345,11 @@ private:
   // by DeclContext objects.  This probably should not be in ASTContext,
   // but we include it here so that ASTContext can quickly deallocate them.
   llvm::PointerIntPair<StoredDeclsMap*,1> LastSDM;
+
+  /// \brief A counter used to uniquely identify "blocks".
+  unsigned int UniqueBlockByRefTypeID;
+  unsigned int UniqueBlockParmTypeID;
+  
   friend class DeclContext;
   friend class DeclarationNameTable;
   void ReleaseDeclContextMaps();
index 2db5c5e914a419d333e3962a822e3e5d608c5922..bb62e9efd584ee5ad1e5393b60cd7a1732ee2c7d 100644 (file)
@@ -142,7 +142,8 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
   BuiltinInfo(builtins),
   DeclarationNames(*this),
   ExternalSource(0), PrintingPolicy(LOpts),
-  LastSDM(0, 0) {
+  LastSDM(0, 0),
+  UniqueBlockByRefTypeID(0), UniqueBlockParmTypeID(0) {
   ObjCIdRedefinitionType = QualType();
   ObjCClassRedefinitionType = QualType();
   ObjCSelRedefinitionType = QualType();
@@ -3154,7 +3155,6 @@ QualType ASTContext::BuildByRefType(const char *DeclName, QualType Ty) {
   bool HasCopyAndDispose = BlockRequiresCopying(Ty);
 
   // FIXME: Move up
-  static unsigned int UniqueBlockByRefTypeID = 0;
   llvm::SmallString<36> Name;
   llvm::raw_svector_ostream(Name) << "__Block_byref_" <<
                                   ++UniqueBlockByRefTypeID << '_' << DeclName;
@@ -3206,7 +3206,6 @@ QualType ASTContext::getBlockParmType(
   llvm::SmallVectorImpl<const Expr *> &Layout) {
 
   // FIXME: Move up
-  static unsigned int UniqueBlockParmTypeID = 0;
   llvm::SmallString<36> Name;
   llvm::raw_svector_ostream(Name) << "__block_literal_"
                                   << ++UniqueBlockParmTypeID;