diff options
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/Module.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 0bf8be9..6599730 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1021,8 +1021,8 @@ void SlotTracker::processModule() { // Add metadata used by named metadata. for (const NamedMDNode &NMD : TheModule->named_metadata()) { - for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) - CreateMetadataSlot(NMD.getOperand(i)); + for (const MDNode *N : NMD.operands()) + CreateMetadataSlot(N); } for (const Function &F : *TheModule) { diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index 16c7944..c966c53 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -387,8 +387,7 @@ void Module::setModuleFlag(ModFlagBehavior Behavior, StringRef Key, Metadata *Val) { NamedMDNode *ModFlags = getOrInsertModuleFlagsMetadata(); // Replace the flag if it already exists. - for (unsigned I = 0, E = ModFlags->getNumOperands(); I != E; ++I) { - MDNode *Flag = ModFlags->getOperand(I); + for (MDNode *Flag : ModFlags->operands()) { ModFlagBehavior MFB; MDString *K = nullptr; Metadata *V = nullptr; |