From 22d00c4b5b0845531feead561116ede02a7354b9 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 2 Sep 2009 21:22:09 +0000 Subject: Use CallbackVH, instead of WeakVH, to hold MDNode elements. Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/LLVMContextImpl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/VMCore/LLVMContextImpl.h') diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h index eeafeaf..1ee4ad7 100644 --- a/lib/VMCore/LLVMContextImpl.h +++ b/lib/VMCore/LLVMContextImpl.h @@ -19,6 +19,7 @@ #include "LeaksContext.h" #include "TypesContext.h" #include "llvm/LLVMContext.h" +#include "llvm/Metadata.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/System/Mutex.h" @@ -106,10 +107,12 @@ public: StringMap MDStringCache; + FoldingSet MDNodeSet; + ValueMap AggZeroConstants; SmallPtrSet MDNodes; - + typedef ValueMap, ArrayType, ConstantArray, true /*largekey*/> ArrayConstantsTy; ArrayConstantsTy ArrayConstants; @@ -199,7 +202,6 @@ public: ArrayConstants.freeConstants(); StructConstants.freeConstants(); VectorConstants.freeConstants(); - AggZeroConstants.freeConstants(); NullPtrConstants.freeConstants(); UndefValueConstants.freeConstants(); -- cgit v1.1