mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -127,11 +127,9 @@ Module *llvm::CloneModule(const Module *M,
|
||||
for (Module::const_named_metadata_iterator I = M->named_metadata_begin(),
|
||||
E = M->named_metadata_end(); I != E; ++I) {
|
||||
const NamedMDNode &NMD = *I;
|
||||
SmallVector<MDNode*, 4> MDs;
|
||||
NamedMDNode *NewNMD = New->getOrInsertNamedMetadata(NMD.getName());
|
||||
for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i)
|
||||
MDs.push_back(cast<MDNode>(MapValue(NMD.getOperand(i), VMap)));
|
||||
NamedMDNode::Create(New->getContext(), NMD.getName(),
|
||||
MDs.data(), MDs.size(), New);
|
||||
NewNMD->addOperand(cast<MDNode>(MapValue(NMD.getOperand(i), VMap)));
|
||||
}
|
||||
|
||||
// Update metadata attach with instructions.
|
||||
|
Reference in New Issue
Block a user