[llvm] r226495 - IR: Move replaceAllUsesWith() back up to MDNode
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 19 11:35:21 PST 2015
Author: dexonsmith
Date: Mon Jan 19 13:35:21 2015
New Revision: 226495
URL: http://llvm.org/viewvc/llvm-project?rev=226495&view=rev
Log:
IR: Move replaceAllUsesWith() back up to MDNode
Move `MDNodeFwdDecl::replaceAllUsesWith()` back up to `MDNode`, but
assert `isTemporary()`.
Modified:
llvm/trunk/include/llvm/IR/Metadata.h
Modified: llvm/trunk/include/llvm/IR/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=226495&r1=226494&r2=226495&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.h (original)
+++ llvm/trunk/include/llvm/IR/Metadata.h Mon Jan 19 13:35:21 2015
@@ -734,6 +734,15 @@ public:
bool isDistinct() const { return Storage == Distinct; }
bool isTemporary() const { return Storage == Temporary; }
+ /// \brief RAUW a temporary.
+ ///
+ /// \pre \a isTemporary() must be \c true.
+ void replaceAllUsesWith(Metadata *MD) {
+ assert(isTemporary() && "Expected temporary node");
+ assert(!isResolved() && "Expected RAUW support");
+ Context.getReplaceableUses()->replaceAllUsesWith(MD);
+ }
+
protected:
/// \brief Set an operand.
///
@@ -971,11 +980,6 @@ public:
static bool classof(const Metadata *MD) {
return MD->getMetadataID() == MDNodeFwdDeclKind;
}
-
- void replaceAllUsesWith(Metadata *MD) {
- assert(Context.hasReplaceableUses() && "Expected RAUW support");
- Context.getReplaceableUses()->replaceAllUsesWith(MD);
- }
};
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list