[llvm] r276600 - [Utils] Simplify combineMetadata
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 24 19:21:20 PDT 2016
Author: majnemer
Date: Sun Jul 24 21:21:19 2016
New Revision: 276600
URL: http://llvm.org/viewvc/llvm-project?rev=276600&view=rev
Log:
[Utils] Simplify combineMetadata
Use a range-based for loop, no functional change is intended.
Modified:
llvm/trunk/lib/Transforms/Utils/Local.cpp
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=276600&r1=276599&r2=276600&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Sun Jul 24 21:21:19 2016
@@ -1586,10 +1586,10 @@ void llvm::combineMetadata(Instruction *
SmallVector<std::pair<unsigned, MDNode *>, 4> Metadata;
K->dropUnknownNonDebugMetadata(KnownIDs);
K->getAllMetadataOtherThanDebugLoc(Metadata);
- for (unsigned i = 0, n = Metadata.size(); i < n; ++i) {
- unsigned Kind = Metadata[i].first;
+ for (const auto &MD : Metadata) {
+ unsigned Kind = MD.first;
MDNode *JMD = J->getMetadata(Kind);
- MDNode *KMD = Metadata[i].second;
+ MDNode *KMD = MD.second;
switch (Kind) {
default:
More information about the llvm-commits
mailing list