Граф коммитов

27 Коммитов

Автор SHA1 Сообщение Дата
Hans Wennborg c8769460f1 Treat -Wformat=0 as an alias for -Wformat.
Fixes PR9195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148300 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 09:30:38 +00:00
Richard Smith 08d6e032a2 C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 19:06:07 +00:00
Benjamin Kramer 4e969445d3 Add missing equals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145290 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 22:17:09 +00:00
Chad Rosier 99643d951e Typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 19:03:03 +00:00
Chad Rosier 496cc8eae2 Fix a regression from 143657. The second pass of the warning options should only be emitting
warnings/errors for unknown warning options.  getDiagnosticsInGroup returns false if the 
diagnostics is found and true otherwise.  Thus, if we're reporting and we have a valid 
diagnostic, we were actually setting the flag and causing mayhem.
rdar://10444207

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 18:57:32 +00:00
Benjamin Kramer dce6327160 Warning option typo correction: When two options have the same edit_distance don't display either.
Also add a maximum edit distance threshold, so we don't correct "-Wx" to "-W#pragma-messages".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15 12:26:39 +00:00
Benjamin Kramer a70cb9db9d Print a typo correction hint for unknown warning flags.
$ clang -Wololo t.c
warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144591 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14 23:30:34 +00:00
Chad Rosier 05272a6594 Parse the warning options twice. The first pass sets diagnostic state, while
the second pass reports warnings/errors.  This has the effect that we follow 
the more canonical "last option wins" paradigm when there are conflicting 
options.
rdar://10383776

Previously, we parsed the warning options in order.  This caused non-intuitive
behavior:

1) clang test.c -Wnosuchwarning -Wno-unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
[0 warning generated.]

2) clang test.c -Wnosuchwarning -Werror=unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

3) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
After:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
2 warnings generated.

4) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wno-unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

After:
[0 warning generated.]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 21:23:39 +00:00
Daniel Dunbar 4aa8f2bce0 Basic/Diagnostic: Factor out
DiagnosticsEngine::setDiagnosticGroup{ErrorAsFatal,WarningAsError} methods which
more accurately model the correct API -- no internal change to the diagnostics
engine yet though.
 - Also, stop honoring -Werror=everything (etc.) as a valid (but oddly behaved) option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 00:53:47 +00:00
David Blaikie d6471f7c19 Rename Diagnostic to DiagnosticsEngine as per issue 5397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25 23:23:43 +00:00
Ted Kremenek 1e473ccb0e Implement '-Weverything', which enables all warnings except those explicitly mapped to be ignored.
Currently this includes -pedantic warnings as well; we'll need to consider whether these should
be included.

This works as expected with -Werror.

Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into
their own test file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 01:12:56 +00:00
Chris Lattner 5f9e272e63 remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 10:55:15 +00:00
Matt Beaumont-Gay 5a4cca2cc5 Don't warn about -Wno-foo where foo is an unknown warning option. Explicitly
passing -Wunknown-warning-option will re-enable warnings about -Wno-foo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132570 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 18:30:50 +00:00
Argyrios Kyrtzidis 477aab6782 A StringRef-ication of the DiagnosticIDs API and internals.
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.

Depends on llvm commit r132046.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 05:05:01 +00:00
Jeffrey Yasskin 5edbdcc620 Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed.  We default to 'all'.  At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 05:57:47 +00:00
Douglas Gregor 575cf37912 Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

  note: suppressed 2 template instantiation contexts; use
  -ftemplate-backtrace-limit=N to change the number of template
  instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 07:18:24 +00:00
Chris Lattner c100214fdc add clang -cc1 level support for "-ferror-limit 42"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:37:06 +00:00
Kovarththanan Rajaratnam 5bf932bd0d Simplify ProcessWarningOptions since it can't fail
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 09:36:02 +00:00
Chris Lattner a3b089e062 switch -Werror/-Wfatal-errors error conditions to use diagnostics instead
of printf, patch by Christian Adaker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:53:37 +00:00
Chris Lattner e663c72006 implement -W[no-]fatal-errors, patch by Christian Adåker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 23:12:53 +00:00
Daniel Dunbar 6907943901 Move warning options into DiagnosticOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:28:44 +00:00
Daniel Dunbar 0f9fed70ce Add Diagnostic::Report method for reporting diagnostics without a location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:55:23 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Shantonu Sen b1d76bda73 PR4715
-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 04:07:15 +00:00
Chris Lattner 8ea841b115 switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Among other things, this makes the warning about unknown warning options mappable.
For example:

$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]

For another thing, they are properly color coded now too :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 01:20:39 +00:00
Eli Friedman ac8d6298a8 Clean up some unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-19 04:30:57 +00:00
Eli Friedman b09f6e15c5 Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp
files to lib/Frontend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-19 04:14:29 +00:00