Skip to content

[IR] Use range-based for loops (NFC) #97950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/IR/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading