r212620 - cc1as: consolidate option flags with cc1 and eliminate duplication

Nick Lewycky nlewycky at google.com
Wed Jul 9 17:41:33 PDT 2014


On 9 July 2014 07:05, Alp Toker <alp at nuanti.com> wrote:

> Author: alp
> Date: Wed Jul  9 09:05:11 2014
> New Revision: 212620
>
> URL: http://llvm.org/viewvc/llvm-project?rev=212620&view=rev
> Log:
> cc1as: consolidate option flags with cc1 and eliminate duplication
>
> The clang -cc1as options are nearly a strict subset of -cc1. Instead of
> duplicating the definitions and documentation, let's go ahead and share the
> definitions in a similar way the current handling of combined driver and
> frontend flags, eliminating some of the vestigial legacy surrounding the
> assembler subcommand.
>

Nice!

Removed:
>     cfe/trunk/include/clang/Driver/CC1AsOptions.h
>     cfe/trunk/include/clang/Driver/CC1AsOptions.td
>     cfe/trunk/lib/Driver/CC1AsOptions.cpp
> Modified:
>     cfe/trunk/include/clang/Driver/CC1Options.td
>     cfe/trunk/include/clang/Driver/CMakeLists.txt
>     cfe/trunk/include/clang/Driver/Options.h
>     cfe/trunk/include/clang/Driver/Options.td
>     cfe/trunk/lib/Driver/CMakeLists.txt
>     cfe/trunk/tools/driver/cc1as_main.cpp
>
>

> +#if 0
> +bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
> +                                        const char *const *ArgBegin,
> +                                        const char *const *ArgEnd,
> +                                        DiagnosticsEngine &Diags) {
> +  bool Success = true;
> +
> +  // Parse the arguments.
> +  std::unique_ptr<OptTable> Opts(createDriverOptTable());
> +  const unsigned IncludedFlagsBitmask = options::CC1Option;
> +  unsigned MissingArgIndex, MissingArgCount;
> +  std::unique_ptr<InputArgList> Args(
> +                                     Opts->ParseArgs(ArgBegin, ArgEnd,
> MissingArgIndex, MissingArgCount,
> +
> IncludedFlagsBitmask));
> +
> +  // Check for missing argument error.
> +  if (MissingArgCount) {
> +    Diags.Report(diag::err_drv_missing_argument)
> +    << Args->getArgString(MissingArgIndex) << MissingArgCount;
> +    Success = false;
> +  }
> +
> +  // Issue errors on unknown arguments.
> +  for (arg_iterator it = Args->filtered_begin(OPT_UNKNOWN),
> +       ie = Args->filtered_end(); it != ie; ++it) {
> +    Diags.Report(diag::err_drv_unknown_argument) <<
> (*it)->getAsString(*Args);
> +    Success = false;
> +  }
> +}
> +#endif
>

New #if 0'd vestiges? :)

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140709/27ed4bda/attachment.html>


More information about the cfe-commits mailing list