mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC
Now that the clone methods used by `MapMetadata()` don't do any remapping (and return a temporary), they make more sense as member functions on `MDNode` (and subclasses). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -418,6 +418,17 @@ MDNode::MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
|
||||
this->Context.makeReplaceable(make_unique<ReplaceableMetadataImpl>(Context));
|
||||
}
|
||||
|
||||
TempMDNode MDNode::clone() const {
|
||||
switch (getMetadataID()) {
|
||||
default:
|
||||
llvm_unreachable("Invalid MDNode subclass");
|
||||
#define HANDLE_MDNODE_LEAF(CLASS) \
|
||||
case CLASS##Kind: \
|
||||
return cast<CLASS>(this)->cloneImpl();
|
||||
#include "llvm/IR/Metadata.def"
|
||||
}
|
||||
}
|
||||
|
||||
static bool isOperandUnresolved(Metadata *Op) {
|
||||
if (auto *N = dyn_cast_or_null<MDNode>(Op))
|
||||
return !N->isResolved();
|
||||
|
Reference in New Issue
Block a user