From 01965616973bb35c63a0bff1fc40036b9002f1c7 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 12 Jan 2015 20:11:32 +0000 Subject: [PATCH] IR: Push storeDistinctInContext() down to UniquableMDNode, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225683 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Metadata.h | 3 ++- lib/IR/Metadata.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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); -- 2.34.1