r224954 - Driver: convert a couple more instances to range based loops
Saleem Abdulrasool
compnerd at compnerd.org
Mon Dec 29 13:02:47 PST 2014
Author: compnerd
Date: Mon Dec 29 15:02:47 2014
New Revision: 224954
URL: http://llvm.org/viewvc/llvm-project?rev=224954&view=rev
Log:
Driver: convert a couple more instances to range based loops
More conversion to range based for loops rather than direct iterators with
dereferencing. NFC.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=224954&r1=224953&r2=224954&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Dec 29 15:02:47 2014
@@ -1382,9 +1382,8 @@ void Driver::BuildJobs(Compilation &C) c
// files.
if (FinalOutput) {
unsigned NumOutputs = 0;
- for (ActionList::const_iterator it = C.getActions().begin(),
- ie = C.getActions().end(); it != ie; ++it)
- if ((*it)->getType() != types::TY_Nothing)
+ for (const Action *A : C.getActions())
+ if (A->getType() != types::TY_Nothing)
++NumOutputs;
if (NumOutputs > 1) {
@@ -1580,8 +1579,7 @@ void Driver::BuildJobsForAction(Compilat
// Only use pipes when there is exactly one input.
InputInfoList InputInfos;
- for (ActionList::const_iterator it = Inputs->begin(), ie = Inputs->end();
- it != ie; ++it) {
+ for (const Action *Input : *Inputs) {
// Treat dsymutil and verify sub-jobs as being at the top-level too, they
// shouldn't get temporary output names.
// FIXME: Clean this up.
@@ -1590,7 +1588,7 @@ void Driver::BuildJobsForAction(Compilat
SubJobAtTopLevel = true;
InputInfo II;
- BuildJobsForAction(C, *it, TC, BoundArch, SubJobAtTopLevel, MultipleArchs,
+ BuildJobsForAction(C, Input, TC, BoundArch, SubJobAtTopLevel, MultipleArchs,
LinkingOutput, II);
InputInfos.push_back(II);
}
More information about the cfe-commits
mailing list