[cfe-commits] r158796 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp test/Driver/warning-options.cpp

Chandler Carruth chandlerc at google.com
Wed Jun 20 00:21:16 PDT 2012


On Wed, Jun 20, 2012 at 12:03 AM, Ted Kremenek <kremenek at apple.com> wrote:

> Author: kremenek
> Date: Wed Jun 20 02:03:37 2012
> New Revision: 158796
>
> URL: http://llvm.org/viewvc/llvm-project?rev=158796&view=rev
> Log:
> Revert "Provide a -no-pedantic to cancel out -pedantic."  This needs to be
> designed
> a bit further.  We may wish to just have -Wno flags to silence warnings,
> and not have a -no-pedantic.
>

Why? This seems to make using '-pedantic' fairly problematic...

A lot of build systems essentially only allow appending flags to change the
build flags in use, and it seems bad to leave flags around which "poison"
the entire command because of a lack of a '-no-*' variant.

Note that I'm not really endorsing the use of '-pedantic'; I generally
prefer the -W flags (with their -Wno- variants). I'm just a bit concerned
about not allowing appending an option to reverse the decision about
'-pedantic'.


>
> Modified:
>    cfe/trunk/include/clang/Driver/Options.td
>    cfe/trunk/lib/Driver/Tools.cpp
>    cfe/trunk/test/Driver/warning-options.cpp
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=158796&r1=158795&r2=158796&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Wed Jun 20 02:03:37 2012
> @@ -838,7 +838,6 @@
>  def no_cpp_precomp : Flag<"-no-cpp-precomp">,
> Group<clang_ignored_f_Group>;
>  def no_integrated_as : Flag<"-no-integrated-as">, Flags<[DriverOption]>;
>  def no_integrated_cpp : Flag<"-no-integrated-cpp">, Flags<[DriverOption]>;
> -def no_pedantic : Flag<"-no-pedantic">, Group<pedantic_Group>;
>  def no__dead__strip__inits__and__terms :
> Flag<"-no_dead_strip_inits_and_terms">;
>  def nobuiltininc : Flag<"-nobuiltininc">, Flags<[CC1Option]>,
>   HelpText<"Disable builtin #include directories">;
> @@ -1041,7 +1040,6 @@
>  def _machine : Separate<"--machine">, Alias<m_Joined>;
>  def _no_integrated_cpp : Flag<"--no-integrated-cpp">,
> Alias<no_integrated_cpp>;
>  def _no_line_commands : Flag<"--no-line-commands">, Alias<P>;
> -def _no_pedantic : Flag<"--no-pedantic">, Alias<no_pedantic>;
>  def _no_standard_includes : Flag<"--no-standard-includes">,
> Alias<nostdinc>;
>  def _no_standard_libraries : Flag<"--no-standard-libraries">,
> Alias<nostdlib>;
>  def _no_undefined : Flag<"--no-undefined">, Flags<[LinkerInput]>;
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=158796&r1=158795&r2=158796&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Wed Jun 20 02:03:37 2012
> @@ -2034,8 +2034,7 @@
>   }
>
>   Args.AddAllArgs(CmdArgs, options::OPT_W_Group);
> -  if (Args.hasFlag(options::OPT_pedantic, options::OPT_no_pedantic,
> false))
> -    CmdArgs.push_back("-pedantic");
> +  Args.AddLastArg(CmdArgs, options::OPT_pedantic);
>   Args.AddLastArg(CmdArgs, options::OPT_pedantic_errors);
>   Args.AddLastArg(CmdArgs, options::OPT_w);
>
>
> Modified: cfe/trunk/test/Driver/warning-options.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/warning-options.cpp?rev=158796&r1=158795&r2=158796&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/warning-options.cpp (original)
> +++ cfe/trunk/test/Driver/warning-options.cpp Wed Jun 20 02:03:37 2012
> @@ -9,10 +9,6 @@
>  // CHECK: unknown warning option '-Wno-monkey'
>  // CHECK: unknown warning option '-Wno-unused-command-line-arguments';
> did you mean '-Wno-unused-command-line-argument'?
>
> -// RUN: %clang -### -pedantic -no-pedantic %s 2>&1 | FileCheck
> -check-prefix=NO_PEDANTIC %s
> -// NO_PEDANTIC-NOT: -pedantic
> -// RUN: %clang -### -pedantic -pedantic -no-pedantic -pedantic %s 2>&1 |
> FileCheck -check-prefix=PEDANTIC %s
> -// PEDANTIC: -pedantic
> -
>  // PR12920: They use gcc driver. Clang tends to pass -pedantic to gcc-as
> and gcc-ld.
>  // XFAIL: cygwin,mingw32
> +
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120620/9aba41fc/attachment.html>


More information about the cfe-commits mailing list