diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-21 20:55:28 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-21 20:55:28 +0000 |
commit | 3d7434bf13c437b53bbfbf162d97387f72fb503b (patch) | |
tree | 66b5ecb11b41613c409a726addc82dd054c9de70 /lib/VMCore/LLVMContextImpl.h | |
parent | 07768e252ded6579d6c46a74a22ab66cb7133e22 (diff) | |
download | external_llvm-3d7434bf13c437b53bbfbf162d97387f72fb503b.zip external_llvm-3d7434bf13c437b53bbfbf162d97387f72fb503b.tar.gz external_llvm-3d7434bf13c437b53bbfbf162d97387f72fb503b.tar.bz2 |
Privatize the ConstantArray table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.h')
-rw-r--r-- | lib/VMCore/LLVMContextImpl.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index e2c2537..03f0e7b 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -30,7 +30,7 @@ template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false /*true for arrays and structs*/ > -class ContextValueMap; +class ValueMap; namespace llvm { template<class ValType> @@ -111,7 +111,11 @@ class LLVMContextImpl { FoldingSet<MDNode> MDNodeSet; - ContextValueMap<char, Type, ConstantAggregateZero> *AggZeroConstants; + ValueMap<char, Type, ConstantAggregateZero> *AggZeroConstants; + + typedef ValueMap<std::vector<Constant*>, ArrayType, + ConstantArray, true /*largekey*/> ArrayConstantsTy; + ArrayConstantsTy *ArrayConstants; LLVMContext &Context; ConstantInt *TheTrueVal; @@ -135,6 +139,9 @@ public: ConstantAggregateZero *getConstantAggregateZero(const Type *Ty); + Constant *getConstantArray(const ArrayType *Ty, + const std::vector<Constant*> &V); + ConstantInt *getTrue() { if (TheTrueVal) return TheTrueVal; @@ -152,6 +159,12 @@ public: void erase(MDString *M); void erase(MDNode *M); void erase(ConstantAggregateZero *Z); + void erase(ConstantArray *C); + + // RAUW helpers + + Constant *replaceUsesOfWithOnConstant(ConstantArray *CA, Value *From, + Value *To, Use *U); }; } |