[llvm] r243865 - ValueMapper: Use a range-based for, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Sun Aug 2 20:27:12 PDT 2015
Author: dexonsmith
Date: Sun Aug 2 22:27:12 2015
New Revision: 243865
URL: http://llvm.org/viewvc/llvm-project?rev=243865&view=rev
Log:
ValueMapper: Use a range-based for, NFC
Modified:
llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=243865&r1=243864&r2=243865&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Sun Aug 2 22:27:12 2015
@@ -374,14 +374,11 @@ void llvm::RemapInstruction(Instruction
// Remap attached metadata.
SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
I->getAllMetadata(MDs);
- for (SmallVectorImpl<std::pair<unsigned, MDNode *>>::iterator
- MI = MDs.begin(),
- ME = MDs.end();
- MI != ME; ++MI) {
- MDNode *Old = MI->second;
+ for (const auto &MI : MDs) {
+ MDNode *Old = MI.second;
MDNode *New = MapMetadata(Old, VMap, Flags, TypeMapper, Materializer);
if (New != Old)
- I->setMetadata(MI->first, New);
+ I->setMetadata(MI.first, New);
}
if (!TypeMapper)
More information about the llvm-commits
mailing list