diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-23 23:25:33 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-23 23:25:33 +0000 |
commit | 006c77df8cc7f6a9dac575600b797b8ba32b29eb (patch) | |
tree | 6e1d4a07734c199f8a3245fab69bf516ff93fce5 /lib/VMCore/LLVMContextImpl.h | |
parent | ed0e2adc7076365596ee3d26d5ba5240ce13f23d (diff) |
Privatize the ConstantStruct table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.h')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index 392e500f12..f313ed6207 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -27,6 +27,7 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringMap.h" #include <map> +#include <vector> template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false /*true for arrays and structs*/ > @@ -117,6 +118,10 @@ class LLVMContextImpl { ConstantArray, true /*largekey*/> ArrayConstantsTy; ArrayConstantsTy *ArrayConstants; + typedef ValueMap<std::vector<Constant*>, StructType, + ConstantStruct, true /*largekey*/> StructConstantsTy; + StructConstantsTy *StructConstants; + LLVMContext &Context; ConstantInt *TheTrueVal; ConstantInt *TheFalseVal; @@ -142,6 +147,9 @@ public: Constant *getConstantArray(const ArrayType *Ty, const std::vector<Constant*> &V); + Constant *getConstantStruct(const StructType *Ty, + const std::vector<Constant*> &V); + ConstantInt *getTrue() { if (TheTrueVal) return TheTrueVal; @@ -160,11 +168,14 @@ public: void erase(MDNode *M); void erase(ConstantAggregateZero *Z); void erase(ConstantArray *C); + void erase(ConstantStruct *S); // RAUW helpers Constant *replaceUsesOfWithOnConstant(ConstantArray *CA, Value *From, Value *To, Use *U); + Constant *replaceUsesOfWithOnConstant(ConstantStruct *CS, Value *From, + Value *To, Use *U); }; } |