summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c888b87)
raw | patch | inline | side by side (parent: c888b87)
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | |
Mon, 19 Jan 2015 19:35:21 +0000 (19:35 +0000) | ||
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | |
Mon, 19 Jan 2015 19:35:21 +0000 (19:35 +0000) |
Move `MDNodeFwdDecl::replaceAllUsesWith()` back up to `MDNode`, but
assert `isTemporary()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226495 91177308-0d34-0410-b5e6-96231b3b80d8
assert `isTemporary()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226495 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Metadata.h | patch | blob | history |
index a7fc7b7e51ea72f88da2894338d4fe168272e9aa..5371efba122407e545f585e7d2f6f616e39f5993 100644 (file)
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.
///
static bool classof(const Metadata *MD) {
return MD->getMetadataID() == MDNodeFwdDeclKind;
}
-
- void replaceAllUsesWith(Metadata *MD) {
- assert(Context.hasReplaceableUses() && "Expected RAUW support");
- Context.getReplaceableUses()->replaceAllUsesWith(MD);
- }
};
//===----------------------------------------------------------------------===//