git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225901
91177308-0d34-0410-b5e6-
96231b3b80d8
const MDNode *Node = cast<MDNode>(MD);
assert(Node->isResolved() && "Unexpected unresolved node");
const MDNode *Node = cast<MDNode>(MD);
assert(Node->isResolved() && "Unexpected unresolved node");
- auto getMappedOp = [&](Metadata *Op) -> Metadata *{
- return mapMetadataOp(Op, VM, Flags, TypeMapper, Materializer);
- };
-
// If this is a module-level metadata and we know that nothing at the
// module level is changing, then use an identity mapping.
if (Flags & RF_NoModuleLevelChanges)
// If this is a module-level metadata and we know that nothing at the
// module level is changing, then use an identity mapping.
if (Flags & RF_NoModuleLevelChanges)
// Fix the operands.
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I)
// Fix the operands.
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I)
- NewMD->replaceOperandWith(I, getMappedOp(Node->getOperand(I)));
+ NewMD->replaceOperandWith(I, mapMetadataOp(Node->getOperand(I), VM, Flags,
+ TypeMapper, Materializer));
// Check all operands to see if any need to be remapped.
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I) {
Metadata *Op = Node->getOperand(I);
// Check all operands to see if any need to be remapped.
for (unsigned I = 0, E = Node->getNumOperands(); I != E; ++I) {
Metadata *Op = Node->getOperand(I);
- Metadata *MappedOp = getMappedOp(Op);
+ Metadata *MappedOp = mapMetadataOp(Op, VM, Flags, TypeMapper, Materializer);
if (Op == MappedOp)
continue;
if (Op == MappedOp)
continue;
SmallVector<Metadata *, 4> Elts;
Elts.reserve(Node->getNumOperands());
for (I = 0; I != E; ++I)
SmallVector<Metadata *, 4> Elts;
Elts.reserve(Node->getNumOperands());
for (I = 0; I != E; ++I)
- Elts.push_back(getMappedOp(Node->getOperand(I)));
+ Elts.push_back(mapMetadataOp(Node->getOperand(I), VM, Flags, TypeMapper,
+ Materializer));
MDNode *NewMD = MDTuple::get(Node->getContext(), Elts);
Dummy->replaceAllUsesWith(NewMD);
MDNode *NewMD = MDTuple::get(Node->getContext(), Elts);
Dummy->replaceAllUsesWith(NewMD);