From 3d7434bf13c437b53bbfbf162d97387f72fb503b Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 21 Jul 2009 20:55:28 +0000 Subject: Privatize the ConstantArray table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76639 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/LLVMContextImpl.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lib/VMCore/LLVMContextImpl.h') 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 ContextValueMap; +class ValueMap; namespace llvm { template @@ -111,7 +111,11 @@ class LLVMContextImpl { FoldingSet MDNodeSet; - ContextValueMap *AggZeroConstants; + ValueMap *AggZeroConstants; + + typedef ValueMap, 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 &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); }; } -- cgit v1.1