Cleanup: use range-based for rather than separate calls to begin and end.
llvm-svn: 295524
This commit is contained in:
parent
a84404c7a4
commit
0aef305f35
|
@ -1456,16 +1456,15 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
|
||||||
? types::TY_C
|
? types::TY_C
|
||||||
: types::TY_CXX;
|
: types::TY_CXX;
|
||||||
|
|
||||||
arg_iterator it =
|
Arg *Previous = nullptr;
|
||||||
Args.filtered_begin(options::OPT__SLASH_TC, options::OPT__SLASH_TP);
|
|
||||||
const arg_iterator ie = Args.filtered_end();
|
|
||||||
Arg *Previous = *it++;
|
|
||||||
bool ShowNote = false;
|
bool ShowNote = false;
|
||||||
while (it != ie) {
|
for (Arg *A : Args.filtered(options::OPT__SLASH_TC, options::OPT__SLASH_TP)) {
|
||||||
Diag(clang::diag::warn_drv_overriding_flag_option)
|
if (Previous) {
|
||||||
<< Previous->getSpelling() << (*it)->getSpelling();
|
Diag(clang::diag::warn_drv_overriding_flag_option)
|
||||||
Previous = *it++;
|
<< Previous->getSpelling() << A->getSpelling();
|
||||||
ShowNote = true;
|
ShowNote = true;
|
||||||
|
}
|
||||||
|
Previous = A;
|
||||||
}
|
}
|
||||||
if (ShowNote)
|
if (ShowNote)
|
||||||
Diag(clang::diag::note_drv_t_option_is_global);
|
Diag(clang::diag::note_drv_t_option_is_global);
|
||||||
|
|
|
@ -212,13 +212,11 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
|
||||||
// Frontend Options
|
// Frontend Options
|
||||||
if (Args.hasArg(OPT_INPUT)) {
|
if (Args.hasArg(OPT_INPUT)) {
|
||||||
bool First = true;
|
bool First = true;
|
||||||
for (arg_iterator it = Args.filtered_begin(OPT_INPUT),
|
for (const Arg *A : Args.filtered(OPT_INPUT)) {
|
||||||
ie = Args.filtered_end();
|
if (First) {
|
||||||
it != ie; ++it, First = false) {
|
|
||||||
const Arg *A = it;
|
|
||||||
if (First)
|
|
||||||
Opts.InputFile = A->getValue();
|
Opts.InputFile = A->getValue();
|
||||||
else {
|
First = false;
|
||||||
|
} else {
|
||||||
Diags.Report(diag::err_drv_unknown_argument) << A->getAsString(Args);
|
Diags.Report(diag::err_drv_unknown_argument) << A->getAsString(Args);
|
||||||
Success = false;
|
Success = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue