diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index bb7d67a..d362e33 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1554,9 +1554,11 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, // Parse the arguments. OwningPtr<OptTable> Opts(createDriverOptTable()); + const unsigned IncludedFlagsBitmask = options::CC1Option; unsigned MissingArgIndex, MissingArgCount; OwningPtr<InputArgList> Args( - Opts->ParseArgs(ArgBegin, ArgEnd,MissingArgIndex, MissingArgCount)); + Opts->ParseArgs(ArgBegin, ArgEnd, MissingArgIndex, MissingArgCount, + IncludedFlagsBitmask)); // Check for missing argument error. if (MissingArgCount) { @@ -1572,17 +1574,6 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, Success = false; } - // Issue errors on arguments that are not valid for CC1. - for (ArgList::iterator I = Args->begin(), E = Args->end(); - I != E; ++I) { - if ((*I)->getOption().matches(options::OPT_INPUT)) - continue; - if (!(*I)->getOption().hasFlag(options::CC1Option)) { - Diags.Report(diag::err_drv_unknown_argument) << (*I)->getAsString(*Args); - Success = false; - } - } - Success = ParseAnalyzerArgs(*Res.getAnalyzerOpts(), *Args, Diags) && Success; Success = ParseMigratorArgs(Res.getMigratorOpts(), *Args) && Success; ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), *Args); |