diff options
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r-- | include/llvm/Metadata.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index cecb7dadaf..e5363228a3 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -108,6 +108,9 @@ 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, @@ -163,7 +166,9 @@ private: bool isNotUniqued() const { return (getSubclassDataFromValue() & NotUniquedBit) != 0; } - void setIsNotUniqued(); + void setIsNotUniqued() { + setValueSubclassData(getSubclassDataFromValue() | NotUniquedBit); + } // Shadow Value::setValueSubclassData with a private forwarding method so that // any future subclasses cannot accidentally use it. |