[Utils] Simplify combineMetadata

Use a range-based for loop, no functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2016-07-25 02:21:19 +00:00
parent 6b25086f00
commit 2d83d8a394

View File

@ -1586,10 +1586,10 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J,
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: