[modularize] Use range-based for loops (NFC) (#144244)

This commit is contained in:
Kazu Hirata 2025-06-15 10:32:30 -07:00 committed by GitHub
parent 886174a835
commit 2669664605
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 8 deletions

View File

@ -329,10 +329,8 @@ bool CoverageChecker::collectFileSystemHeaders() {
else {
// Otherwise we only look at the sub-trees specified by the
// include paths.
for (std::vector<std::string>::const_iterator I = IncludePaths.begin(),
E = IncludePaths.end();
I != E; ++I) {
if (!collectFileSystemHeaders(*I))
for (const std::string &IncludePath : IncludePaths) {
if (!collectFileSystemHeaders(IncludePath))
return false;
}
}

View File

@ -339,8 +339,8 @@ static std::string findInputFile(const CommandLineArguments &CLArgs) {
llvm::opt::Visibility VisibilityMask(options::CC1Option);
unsigned MissingArgIndex, MissingArgCount;
SmallVector<const char *, 256> Argv;
for (auto I = CLArgs.begin(), E = CLArgs.end(); I != E; ++I)
Argv.push_back(I->c_str());
for (const std::string &CLArg : CLArgs)
Argv.push_back(CLArg.c_str());
InputArgList Args = getDriverOptTable().ParseArgs(
Argv, MissingArgIndex, MissingArgCount, VisibilityMask);
std::vector<std::string> Inputs = Args.getAllArgValues(OPT_INPUT);

View File

@ -69,8 +69,7 @@ ModularizeUtilities *ModularizeUtilities::createModularizeUtilities(
// Load all header lists and dependencies.
std::error_code ModularizeUtilities::loadAllHeaderListsAndDependencies() {
// For each input file.
for (auto I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E; ++I) {
llvm::StringRef InputPath = *I;
for (llvm::StringRef InputPath : InputFilePaths) {
// If it's a module map.
if (InputPath.ends_with(".modulemap")) {
// Load the module map.