diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 7 | ||||
| -rw-r--r-- | llvm/lib/IR/Metadata.cpp | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 2938421080b..0d6d9799b46 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -33,6 +33,7 @@ #include "llvm/IR/Metadata.h" #include "llvm/IR/ValueHandle.h" #include "llvm/Support/Dwarf.h" +#include <vector> namespace llvm { @@ -1026,9 +1027,9 @@ public: // MDNodes may be uniqued or not uniqued. When they're not uniqued, they // aren't in the MDNodeSet, but they're still shared between objects, so no - // one object can destroy them. This set allows us to at least destroy them - // on Context destruction. - SmallPtrSet<MDNode *, 1> DistinctMDNodes; + // one object can destroy them. Keep track of them here so we can delete + // them on context teardown. + std::vector<MDNode *> DistinctMDNodes; DenseMap<Type*, ConstantAggregateZero*> CAZConstants; diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index dc0b6317ee6..e753dbc05ca 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -806,7 +806,7 @@ void MDNode::storeDistinctInContext() { #include "llvm/IR/Metadata.def" } - getContext().pImpl->DistinctMDNodes.insert(this); + getContext().pImpl->DistinctMDNodes.push_back(this); } void MDNode::replaceOperandWith(unsigned I, Metadata *New) { |

