diff options
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.h')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index 02df15c..e2c2537 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -17,14 +17,24 @@ #include "llvm/LLVMContext.h" #include "llvm/DerivedTypes.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/System/Mutex.h" #include "llvm/System/RWMutex.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringMap.h" +#include <map> + +template<class ValType, class TypeClass, class ConstantClass, + bool HasLargeKey = false /*true for arrays and structs*/ > +class ContextValueMap; namespace llvm { +template<class ValType> +struct ConstantTraits; class ConstantInt; class ConstantFP; @@ -101,6 +111,8 @@ class LLVMContextImpl { FoldingSet<MDNode> MDNodeSet; + ContextValueMap<char, Type, ConstantAggregateZero> *AggZeroConstants; + LLVMContext &Context; ConstantInt *TheTrueVal; ConstantInt *TheFalseVal; @@ -108,7 +120,8 @@ class LLVMContextImpl { LLVMContextImpl(); LLVMContextImpl(const LLVMContextImpl&); public: - LLVMContextImpl(LLVMContext &C) : Context(C), TheTrueVal(0), TheFalseVal(0) {} + LLVMContextImpl(LLVMContext &C); + ~LLVMContextImpl(); /// Return a ConstantInt with the specified value and an implied Type. The /// type is the integer type that corresponds to the bit width of the value. @@ -120,6 +133,8 @@ public: MDNode *getMDNode(Value*const* Vals, unsigned NumVals); + ConstantAggregateZero *getConstantAggregateZero(const Type *Ty); + ConstantInt *getTrue() { if (TheTrueVal) return TheTrueVal; @@ -136,6 +151,7 @@ public: void erase(MDString *M); void erase(MDNode *M); + void erase(ConstantAggregateZero *Z); }; } |