From: Duncan P. N. Exon Smith Date: Mon, 12 Jan 2015 20:11:32 +0000 (+0000) Subject: IR: Push storeDistinctInContext() down to UniquableMDNode, NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=01965616973bb35c63a0bff1fc40036b9002f1c7;p=oota-llvm.git IR: Push storeDistinctInContext() down to UniquableMDNode, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225683 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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);