summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/Warnings.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier2013-01-151-1/+8
| | | | | | | | | | driver needs to process the warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 llvm-svn: 172497
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Use a .def file for most of the diagnostic options.Douglas Gregor2012-10-231-2/+1
| | | | llvm-svn: 166520
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-1/+1
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Add template type diffing to Clang. This feature will provide a betterRichard Trieu2012-06-261-1/+5
| | | | | | | | | | | | comparison between two templated types when they both appear in a diagnostic. Type elision will remove indentical template arguments, which can be disabled with -fno-elide-type. Cyan highlighting is applied to the differing types. For more formatting, -fdiagnostic-show-template-tree will output the template type as an indented text tree, with differences appearing inline. Template tree works with or without type elision. llvm-svn: 159216
* Tweek r156937 a bit so that the suggestions are correct.Chad Rosier2012-05-161-1/+2
| | | | llvm-svn: 156938
* Warn about -Wno-foo where foo is an unknown warning option. This is helpful Chad Rosier2012-05-161-3/+4
| | | | | | | | | | | for subtle misspellings such as -Wno-unused-command-line-arguments instead of -Wno-unused-command-line-argument. Also fix the diagnostic messages to properly handle -Wno- options. Previously, the positive version was always emitted (i.e., -Wfoo was emitted for -Wno-foo). rdar://11461500 llvm-svn: 156937
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-1/+1
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Fix 80-column violation.Chad Rosier2012-01-311-1/+2
| | | | llvm-svn: 149405
* Due to a bug, -Wno-everything works like -Weverything. Fix the bug by havingArgyrios Kyrtzidis2012-01-271-2/+8
| | | | | | | | | -Wno-everything remap all warnings to ignored. We can now use "-Wno-everything -W<warning>" to ignore all warnings except specific ones. llvm-svn: 149121
* Treat -Wformat=0 as an alias for -Wformat.Hans Wennborg2012-01-171-0/+4
| | | | | | Fixes PR9195. llvm-svn: 148300
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-161-0/+2
| | | | | | | | | | 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. llvm-svn: 146749
* Add missing equals.Benjamin Kramer2011-11-281-2/+3
| | | | llvm-svn: 145290
* Typo.Chad Rosier2011-11-151-5/+5
| | | | llvm-svn: 144672
* Fix a regression from 143657. The second pass of the warning options should ↵Chad Rosier2011-11-151-2/+3
| | | | | | | | | | | 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 llvm-svn: 144670
* Warning option typo correction: When two options have the same edit_distance ↵Benjamin Kramer2011-11-151-14/+18
| | | | | | | | don't display either. Also add a maximum edit distance threshold, so we don't correct "-Wx" to "-W#pragma-messages". llvm-svn: 144644
* Print a typo correction hint for unknown warning flags.Benjamin Kramer2011-11-141-3/+8
| | | | | | | $ clang -Wololo t.c warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option] llvm-svn: 144591
* Parse the warning options twice. The first pass sets diagnostic state, while Chad Rosier2011-11-031-70/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.] llvm-svn: 143657
* Basic/Diagnostic: Factor outDaniel Dunbar2011-09-291-14/+22
| | | | | | | | | 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. llvm-svn: 140747
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-5/+5
| | | | llvm-svn: 140478
* Implement '-Weverything', which enables all warnings except those explicitly ↵Ted Kremenek2011-08-181-0/+7
| | | | | | | | | | | | | | 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. llvm-svn: 137910
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-3/+3
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Don't warn about -Wno-foo where foo is an unknown warning option. ExplicitlyMatt Beaumont-Gay2011-06-031-1/+3
| | | | | | passing -Wunknown-warning-option will re-enable warnings about -Wno-foo. llvm-svn: 132570
* A StringRef-ication of the DiagnosticIDs API and internals.Argyrios Kyrtzidis2011-05-251-27/+22
| | | | | | | | | 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. llvm-svn: 132047
* Add an option -fshow-overloads=best|all to limit the number of overloadJeffrey Yasskin2010-06-111-0/+2
| | | | | | | candidates printed. We default to 'all'. At the moment, 'best' prints only the first 4 overloads, but we'll improve that over time. llvm-svn: 105815
* Introduce a limit on the depth of the template instantiation backtraceDouglas Gregor2010-04-201-0/+2
| | | | | | | | | | | | | | | | 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. llvm-svn: 101882
* add clang -cc1 level support for "-ferror-limit 42"Chris Lattner2010-04-071-0/+4
| | | | llvm-svn: 100687
* Simplify ProcessWarningOptions since it can't failKovarththanan Rajaratnam2010-03-171-3/+1
| | | | llvm-svn: 98721
* switch -Werror/-Wfatal-errors error conditions to use diagnostics insteadChris Lattner2009-12-231-9/+7
| | | | | | of printf, patch by Christian Adaker! llvm-svn: 92019
* implement -W[no-]fatal-errors, patch by Christian Adåker!Chris Lattner2009-12-221-2/+25
| | | | llvm-svn: 91938
* Move warning options into DiagnosticOptions.Daniel Dunbar2009-11-121-8/+7
| | | | llvm-svn: 86968
* Add Diagnostic::Report method for reporting diagnostics without a location.Daniel Dunbar2009-11-101-2/+1
| | | | llvm-svn: 86760
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-7/+7
| | | | llvm-svn: 81346
* PR4715Shantonu Sen2009-08-141-1/+1
| | | | | | | -Wno-error disables WarningsAsErrors instead of mistakenly being treated like -Werror llvm-svn: 78987
* switch Warnings.cpp to use the diagnostics machinery to print diagnostics, ↵Chris Lattner2009-06-231-1/+3
| | | | | | | | | | | | | | 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 :) llvm-svn: 73936
* Clean up some unnecessary includes.Eli Friedman2009-05-191-1/+1
| | | | llvm-svn: 72101
* Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp Eli Friedman2009-05-191-0/+106
files to lib/Frontend. llvm-svn: 72099
OpenPOWER on IntegriCloud