r241106 - More range-based-for-loopification. NFC
Douglas Katzman
dougk at google.com
Tue Jun 30 12:32:58 PDT 2015
Author: dougk
Date: Tue Jun 30 14:32:57 2015
New Revision: 241106
URL: http://llvm.org/viewvc/llvm-project?rev=241106&view=rev
Log:
More range-based-for-loopification. 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=241106&r1=241105&r2=241106&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Jun 30 14:32:57 2015
@@ -215,10 +215,9 @@ DerivedArgList *Driver::TranslateInputAr
DAL->AddFlagArg(A, Opts->getOption(options::OPT_Z_Xlinker__no_demangle));
// Add the remaining values as Xlinker arguments.
- for (unsigned i = 0, e = A->getNumValues(); i != e; ++i)
- if (StringRef(A->getValue(i)) != "--no-demangle")
- DAL->AddSeparateArg(A, Opts->getOption(options::OPT_Xlinker),
- A->getValue(i));
+ for (const StringRef Val : A->getValues())
+ if (Val != "--no-demangle")
+ DAL->AddSeparateArg(A, Opts->getOption(options::OPT_Xlinker), Val);
continue;
}
@@ -260,8 +259,8 @@ DerivedArgList *Driver::TranslateInputAr
// Pick up inputs via the -- option.
if (A->getOption().matches(options::OPT__DASH_DASH)) {
A->claim();
- for (unsigned i = 0, e = A->getNumValues(); i != e; ++i)
- DAL->append(MakeInputArg(*DAL, Opts, A->getValue(i)));
+ for (const StringRef Val : A->getValues())
+ DAL->append(MakeInputArg(*DAL, Opts, Val));
continue;
}
@@ -780,17 +779,13 @@ bool Driver::HandleImmediateArgs(const C
}
if (C.getArgs().hasArg(options::OPT_print_multi_lib)) {
- const MultilibSet &Multilibs = TC.getMultilibs();
-
- for (MultilibSet::const_iterator I = Multilibs.begin(), E = Multilibs.end();
- I != E; ++I) {
- llvm::outs() << *I << "\n";
- }
+ for (const Multilib &Multilib : TC.getMultilibs())
+ llvm::outs() << Multilib << "\n";
return false;
}
if (C.getArgs().hasArg(options::OPT_print_multi_directory)) {
- for (const auto &Multilib : TC.getMultilibs()) {
+ for (const Multilib &Multilib : TC.getMultilibs()) {
if (Multilib.gccSuffix().empty())
llvm::outs() << ".\n";
else {
More information about the cfe-commits
mailing list