Privatize the last bits of static type state.
[oota-llvm.git] / lib / VMCore / LLVMContextImpl.h
index 265201434d866d0a8adcd0a91142e30cfe4b3587..c0ed368baec9d6708a00f94a17900a735da8b228 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/System/Mutex.h"
 #include "llvm/System/RWMutex.h"
+#include "llvm/Assembly/Writer.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/DenseMap.h"
@@ -136,6 +137,18 @@ public:
   // Lock used for guarding access to the type maps.
   sys::SmartMutex<true> TypeMapLock;
   
+  // Recursive lock used for guarding access to AbstractTypeUsers.
+  // NOTE: The true template parameter means this will no-op when we're not in
+  // multithreaded mode.
+  sys::SmartMutex<true> AbstractTypeUsersLock;
+
+  // Concrete/Abstract TypeDescriptions - We lazily calculate type descriptions
+  // for types as they are needed.  Because resolution of types must invalidate
+  // all of the abstract type descriptions, we keep them in a seperate map to 
+  // make this easy.
+  TypePrinting ConcreteTypeDescriptions;
+  TypePrinting AbstractTypeDescriptions;
+  
   TypeMap<ArrayValType, ArrayType> ArrayTypes;
   TypeMap<VectorValType, VectorType> VectorTypes;
   TypeMap<PointerValType, PointerType> PointerTypes;