Go to file
Ted Kremenek 9877f689f2 Implement -Wpedantic and --no-pedantic to complement -Weverything.
This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

llvm-svn: 159875
2012-07-06 23:07:31 +00:00
clang Implement -Wpedantic and --no-pedantic to complement -Weverything. 2012-07-06 23:07:31 +00:00
compiler-rt tsan: Go language support fixes 2012-07-06 20:23:59 +00:00
debuginfo-tests Fix this for buggy gdb behavior alongside the change 2012-06-05 18:16:03 +00:00
libclc configure.py: Add an install rule. 2012-06-01 17:29:59 +00:00
libcxx Apply noexcept to tuple. 2012-07-06 21:53:48 +00:00
libcxxabi Don't dereference root in __parse_ctor_dtor_name unless it is known to not be null. 2012-06-15 21:57:51 +00:00
lld Add missing LLVMSupport 2012-07-04 02:16:35 +00:00
lldb <rdar://problem/11819635> 2012-07-06 17:58:01 +00:00
llvm Since SmallMap was removed in r158644, remove documentation in ProgrammersManual.html. 2012-07-06 23:06:47 +00:00
polly Update libGPURuntime to be dual licensed under MIT and UIUC license. 2012-07-06 10:40:15 +00:00