[cfe-commits] r69154 - in /cfe/trunk: include/clang/Basic/Diagnostic.h lib/Basic/Diagnostic.cpp lib/Parse/ExtensionRAIIObject.h test/Misc/diag-mapping.c tools/clang-cc/Warnings.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Wed Apr 15 00:40:47 PDT 2009


On Wed, 15 Apr 2009 07:01:19 -0000, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Wed Apr 15 02:01:18 2009
> New Revision: 69154
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=69154&view=rev
> Log:
> Rejigger how -pedantic and -pedantic-errors work and their interaction
> with other diagnostic mapping.  In the new scheme, -Wfoo or -Wno-foo or 
> -Werror=foo all override the -pedantic options, and __extension__ 
> robustly silences all extension diagnostics in their scope.

> Modified: cfe/trunk/tools/clang-cc/Warnings.cpp
> URL:
>
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Warnings.cpp?rev=69154&r1=69153&r2=69154&view=diff
> 
>
==============================================================================
> --- cfe/trunk/tools/clang-cc/Warnings.cpp (original)
> +++ cfe/trunk/tools/clang-cc/Warnings.cpp Wed Apr 15 02:01:18 2009
> @@ -125,6 +124,10 @@
>    // FIXME: -fdiagnostics-show-option
>    // FIXME: -Wfatal-errors / -Wfatal-errors=foo
>  
> +  /// ControlledOptions - Keep track of the options that the user
> explicitly
> +  /// poked with -Wfoo, -Wno-foo, or -Werror=foo.
> +  llvm::SmallVector<unsigned short, 256> ControlledDiags;
> +  

Mismatch between comment and variable name.

> @@ -183,8 +186,53 @@
>      }
>      
>      // Option exists, poke all the members of its diagnostic set.
> -    for (unsigned i = 0, e = Found->NumMembers; i != e; ++i)
> -      Diags.setDiagnosticMapping(Found->Members[i], Mapping);
> +    for (const diag::kind *Member = Found->Members,
> +         *E = Found->Members+Found->NumMembers; Member != E; ++Member) {
> +      Diags.setDiagnosticMapping(*Member, Mapping);
> +      assert(*Member < 65536 && "ControlledOptions element too small");
> +      ControlledDiags.push_back(*Member);

Here too.

Sebastian



More information about the cfe-commits mailing list