diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-19 19:35:21 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-19 19:35:21 +0000 |
commit | 290c07e7a87028a85ebe34157fbb639a0a05c4c6 (patch) | |
tree | 3b85e5bf17f1101f738c2cf419708120ed6985a1 | |
parent | 286d7cf9de43f0b2efc13283fec6b373b6f85756 (diff) | |
download | bcm5719-llvm-290c07e7a87028a85ebe34157fbb639a0a05c4c6.tar.gz bcm5719-llvm-290c07e7a87028a85ebe34157fbb639a0a05c4c6.zip |
IR: Move replaceAllUsesWith() back up to MDNode
Move `MDNodeFwdDecl::replaceAllUsesWith()` back up to `MDNode`, but
assert `isTemporary()`.
llvm-svn: 226495
-rw-r--r-- | llvm/include/llvm/IR/Metadata.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h index a7fc7b7e51e..5371efba122 100644 --- a/llvm/include/llvm/IR/Metadata.h +++ b/llvm/include/llvm/IR/Metadata.h @@ -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); - } }; //===----------------------------------------------------------------------===// |