diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-14 01:02:17 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-14 01:02:17 +0000 |
| commit | 3956a85e6e855b195fbc299c068765fe8f1060a1 (patch) | |
| tree | 7869202bb3dcceddf7b6970f83db4a7855bcfc8a /llvm/lib/Transforms/Utils/ValueMapper.cpp | |
| parent | 7813d9c97930a001d418eaaaa71dbfbf62aa4ee6 (diff) | |
| download | bcm5719-llvm-3956a85e6e855b195fbc299c068765fe8f1060a1.tar.gz bcm5719-llvm-3956a85e6e855b195fbc299c068765fe8f1060a1.zip | |
Utils: Use helper function directly, NFC
llvm-svn: 225901
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 0e7bcfd236e..d4bfa9dec12 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -215,10 +215,6 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM, 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) @@ -233,7 +229,8 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM, // 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)); return NewMD; } @@ -245,7 +242,7 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM, // 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; @@ -253,7 +250,8 @@ static Metadata *MapMetadataImpl(const Metadata *MD, ValueToValueMapTy &VM, 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); |

