Skip to content

Commit 2669664

Browse files
[modularize] Use range-based for loops (NFC) (#144244)
1 parent 886174a commit 2669664

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

clang-tools-extra/modularize/CoverageChecker.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,8 @@ bool CoverageChecker::collectFileSystemHeaders() {
329329
else {
330330
// Otherwise we only look at the sub-trees specified by the
331331
// include paths.
332-
for (std::vector<std::string>::const_iterator I = IncludePaths.begin(),
333-
E = IncludePaths.end();
334-
I != E; ++I) {
335-
if (!collectFileSystemHeaders(*I))
332+
for (const std::string &IncludePath : IncludePaths) {
333+
if (!collectFileSystemHeaders(IncludePath))
336334
return false;
337335
}
338336
}

clang-tools-extra/modularize/Modularize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ static std::string findInputFile(const CommandLineArguments &CLArgs) {
339339
llvm::opt::Visibility VisibilityMask(options::CC1Option);
340340
unsigned MissingArgIndex, MissingArgCount;
341341
SmallVector<const char *, 256> Argv;
342-
for (auto I = CLArgs.begin(), E = CLArgs.end(); I != E; ++I)
343-
Argv.push_back(I->c_str());
342+
for (const std::string &CLArg : CLArgs)
343+
Argv.push_back(CLArg.c_str());
344344
InputArgList Args = getDriverOptTable().ParseArgs(
345345
Argv, MissingArgIndex, MissingArgCount, VisibilityMask);
346346
std::vector<std::string> Inputs = Args.getAllArgValues(OPT_INPUT);

clang-tools-extra/modularize/ModularizeUtilities.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ ModularizeUtilities *ModularizeUtilities::createModularizeUtilities(
6969
// Load all header lists and dependencies.
7070
std::error_code ModularizeUtilities::loadAllHeaderListsAndDependencies() {
7171
// For each input file.
72-
for (auto I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E; ++I) {
73-
llvm::StringRef InputPath = *I;
72+
for (llvm::StringRef InputPath : InputFilePaths) {
7473
// If it's a module map.
7574
if (InputPath.ends_with(".modulemap")) {
7675
// Load the module map.

0 commit comments

Comments
 (0)