[modularize] Use a range-based for loop (NFC) (#139398)

This commit is contained in:
Kazu Hirata
2025-05-10 11:03:27 -07:00
committed by GitHub
parent d151ad650c
commit e0dfc49852

View File

@@ -357,11 +357,9 @@ getModularizeArgumentsAdjuster(DependencyMap &Dependencies) {
std::string InputFile = findInputFile(Args);
DependentsVector &FileDependents = Dependencies[InputFile];
CommandLineArguments NewArgs(Args);
if (int Count = FileDependents.size()) {
for (int Index = 0; Index < Count; ++Index) {
NewArgs.push_back("-include");
NewArgs.push_back(FileDependents[Index]);
}
for (const std::string &Dep : FileDependents) {
NewArgs.push_back("-include");
NewArgs.push_back(Dep);
}
// Ignore warnings. (Insert after "clang_tool" at beginning.)
NewArgs.insert(NewArgs.begin() + 1, "-w");