mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Utils: Use MDTuple::get() directly, NFC
Working towards supporting `MDLocation` in `MapMetadata()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61d6dc41fa
commit
cb5c0e6745
@ -216,7 +216,7 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM,
|
|||||||
if (Node->isDistinct()) {
|
if (Node->isDistinct()) {
|
||||||
// Create the node first so it's available for cyclical references.
|
// Create the node first so it's available for cyclical references.
|
||||||
SmallVector<Metadata *, 4> EmptyOps(Node->getNumOperands());
|
SmallVector<Metadata *, 4> EmptyOps(Node->getNumOperands());
|
||||||
MDNode *NewMD = MDNode::getDistinct(Node->getContext(), EmptyOps);
|
MDTuple *NewMD = MDTuple::getDistinct(Node->getContext(), EmptyOps);
|
||||||
mapToMetadata(VM, Node, NewMD);
|
mapToMetadata(VM, Node, NewMD);
|
||||||
|
|
||||||
// Fix the operands.
|
// Fix the operands.
|
||||||
@ -243,7 +243,7 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM,
|
|||||||
for (I = 0; I != E; ++I)
|
for (I = 0; I != E; ++I)
|
||||||
Elts.push_back(getMappedOp(Node->getOperand(I)));
|
Elts.push_back(getMappedOp(Node->getOperand(I)));
|
||||||
|
|
||||||
MDNode *NewMD = MDNode::get(Node->getContext(), Elts);
|
MDNode *NewMD = MDTuple::get(Node->getContext(), Elts);
|
||||||
Dummy->replaceAllUsesWith(NewMD);
|
Dummy->replaceAllUsesWith(NewMD);
|
||||||
MDNode::deleteTemporary(Dummy);
|
MDNode::deleteTemporary(Dummy);
|
||||||
return mapToMetadata(VM, Node, NewMD);
|
return mapToMetadata(VM, Node, NewMD);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user