From c8cfa30ca5e6ce80e3e6e1dbff5d24d266d43d27 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Fri, 5 Mar 2010 05:47:09 +0000 Subject: Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97788 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Metadata.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index e536322..cecb7da 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -108,9 +108,6 @@ class MDNode : public Value, public FoldingSetNode { /// node with T. void replaceOperand(MDNodeOperand *Op, Value *NewVal); ~MDNode(); - /// replaceAllOperandsWithNull - This is used while destroying llvm context to - /// gracefully delete all nodes. This method replaces all operands with null. - void replaceAllOperandsWithNull(); protected: explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, @@ -166,9 +163,7 @@ private: bool isNotUniqued() const { return (getSubclassDataFromValue() & NotUniquedBit) != 0; } - void setIsNotUniqued() { - setValueSubclassData(getSubclassDataFromValue() | NotUniquedBit); - } + void setIsNotUniqued(); // Shadow Value::setValueSubclassData with a private forwarding method so that // any future subclasses cannot accidentally use it. -- cgit v1.1