diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index dbf16408fc0..e0363af57a7 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -603,7 +603,6 @@ protected: ~MDNode() {} void dropAllReferences(); - void storeDistinctInContext(); static MDNode *getMDNode(LLVMContext &C, ArrayRef MDs, bool Insert = true); @@ -735,6 +734,8 @@ protected: bool AllowRAUW); ~UniquableMDNode(); + void storeDistinctInContext(); + public: static bool classof(const Metadata *MD) { return MD->getMetadataID() == MDTupleKind; diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index 282ea49aa41..8ff46735757 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -616,7 +616,7 @@ void MDNode::deleteTemporary(MDNode *N) { delete cast(N); } -void MDNode::storeDistinctInContext() { +void UniquableMDNode::storeDistinctInContext() { assert(!IsDistinctInContext && "Expected newly distinct metadata"); IsDistinctInContext = true; auto *T = cast(this);