summaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-02-18 20:53:16 +0000
committerDevang Patel <dpatel@apple.com>2010-02-18 20:53:16 +0000
commit06fdaccc89d9abdc7e03797b25173791a2f5692f (patch)
tree15113442c68dcae0c3957b9e1755bfbad7769f31 /include/llvm/Metadata.h
parent16c1e79cb2b0b203aa76da4c90c16d9fd096762f (diff)
downloadexternal_llvm-06fdaccc89d9abdc7e03797b25173791a2f5692f.zip
external_llvm-06fdaccc89d9abdc7e03797b25173791a2f5692f.tar.gz
external_llvm-06fdaccc89d9abdc7e03797b25173791a2f5692f.tar.bz2
Destroy MDNodes gracefully while deleting llvm context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 4e459bf..0369f5e 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -75,6 +75,7 @@ class MDNode : public Value, public FoldingSetNode {
MDNode(const MDNode &); // DO NOT IMPLEMENT
void operator=(const MDNode &); // DO NOT IMPLEMENT
friend class MDNodeOperand;
+ friend class LLVMContextImpl;
/// NumOperands - This many 'MDNodeOperand' items are co-allocated onto the
/// end of this MDNode.
@@ -106,6 +107,9 @@ class MDNode : public Value, public FoldingSetNode {
// Replace each instance of F from the operand list of this 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,