summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -Wreturn-type build failure on ASTMatchers, plus an intended assertAlp Toker2014-01-261-1/+1
| | | | llvm-svn: 200140
* Remove flawed diagnostic mapping functionsAlp Toker2014-01-261-35/+0
| | | | | | | These haven't been usable since the early return was accidentally removed some years ago causing all cases to fall through to the !Enabled condition. llvm-svn: 200123
* Bring back magic constants in the digraph diagnosticAlp Toker2014-01-071-2/+0
| | | | | | | | This backs out changes in commit r198605 and part of r198604, replacing the original tok::kw_template with a slightly more obvious placeholder tok::unknown. llvm-svn: 198666
* Support diagnostic formatting of keyword tokensAlp Toker2014-01-061-7/+13
| | | | | | | | | Implemented with a new getKeywordSpelling() accessor. Unlike getTokenName() the result of this function is stable and may be used in diagnostic output. Uses of this feature are split out into the subsequent commit. llvm-svn: 198604
* Rename getTokenSimpleSpelling() to getPunctuatorSpelling()Alp Toker2014-01-061-1/+1
| | | | | | | That's what it does, what the documentation says it does and what callers expect it to do. llvm-svn: 198603
* Teach the diagnostics engine about the Attr type to make reporting on ↵Aaron Ballman2013-12-261-0/+1
| | | | | | semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting. llvm-svn: 198055
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-241-0/+29
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
* Revert r177218.Argyrios Kyrtzidis2013-05-031-1/+0
| | | | | | Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. llvm-svn: 181073
* Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor2013-05-031-5/+0
| | | | llvm-svn: 181070
* When building a module, forward diagnostics to the outer diagnostic consumer.Douglas Gregor2013-05-031-0/+22
| | | | | | | | | | | | | | | Previously, we would clone the current diagnostic consumer to produce a new diagnostic consumer to use when building a module. The problem here is that we end up losing diagnostics for important diagnostic consumers, such as serialized diagnostics (where we'd end up with two diagnostic consumers writing the same output file). With forwarding, the diagnostics from all of the different modules being built get forwarded to the one serialized-diagnostic consumer and are emitted in a sane way. Fixes <rdar://problem/13663996>. llvm-svn: 181067
* Initialize WarnOnSpellCheck.Rafael Espindola2013-05-031-0/+1
| | | | | | | | | Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to do so. Issue noticed by Enea Zaffanella. llvm-svn: 181021
* Moving initialization into the initializer list and correcting ↵Aaron Ballman2013-02-241-4/+3
| | | | | | capitalization, as suggested by Chandler. llvm-svn: 176001
* Fixing a typo where FixIts was accidentally self-assigning instead of ↵Aaron Ballman2013-02-191-1/+1
| | | | | | assigning in the parameter Fixits. This fixes several failed assertions with MSVC debug builds. llvm-svn: 175483
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-7/+7
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Changed to static_cast, due to post-commit review.Filipe Cabecinhas2013-01-301-2/+2
| | | | llvm-svn: 173980
* Cast to remove the narrowing conversion error in c++11.Filipe Cabecinhas2013-01-301-2/+2
| | | | llvm-svn: 173978
* Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu2013-01-301-5/+23
| | | | | | to printing the default case. This is a fix for PR15023. llvm-svn: 173965
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-4/+4
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-201-5/+1
| | | | | | | | produce a note for that diagnostic either with a different DiagnosticEngine or after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the wrong thing if the original diagnostic was suppressed. llvm-svn: 170636
* Fix analysis based warnings so that all warnings are emitted when compilingDeLesley Hutchins2012-12-071-0/+1
| | | | | | | | | with -Werror. Previously, compiling with -Werror would emit only the first warning in a compilation unit, because clang assumes that once an error occurs, further analysis is unlikely to return valid results. However, warnings that have been upgraded to errors should not be treated as "errors" in this sense. llvm-svn: 169649
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | 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
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-2/+4
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Use llvm::getOrdinalSuffix to print ordinal numbers in diagnostics.Jordan Rose2012-09-221-17/+2
| | | | | | Just a refactoring of common infrastructure. No intended functionality change. llvm-svn: 164443
* Avoid binding a reference to a dereferenced null pointer, if we try to emit aRichard Smith2012-08-171-0/+3
| | | | | | diagnostic before we have a source manager. llvm-svn: 162070
* Fix undefined behavior: reference bound to dereferenced null pointer.Richard Smith2012-08-141-1/+2
| | | | llvm-svn: 161899
* Fix undefined behavior: don't bind a dereferenced null pointer to a reference.Richard Smith2012-08-141-1/+1
| | | | | | No functionality change. llvm-svn: 161832
* Add missing cctype includes.Joerg Sonnenberger2012-08-101-0/+1
| | | | llvm-svn: 161660
* Modify tree printing mode for template type diffing. If a diagnostic hasRichard Trieu2012-07-131-2/+3
| | | | | | | multiple %diff's, only print the first tree and fallback to inline printing for the rest of the diagnostic. llvm-svn: 160193
* Emit -verify diagnostics even when we have a fatal error.Jordan Rose2012-07-111-5/+22
| | | | | | | | | | | | | | Previously we'd halt at the fatal error as expected, but not actually emit any -verify-related diagnostics. This lets us catch cases that emit a /different/ fatal error from the one we expected. This is implemented by adding a "force emit" mode to DiagnosticBuilder, which will cause diagnostics to immediately be emitted regardless of current suppression. Needless to say this should probably be used /very/ sparingly. Patch by Andy Gibbs! Tests for all of Andy's -verify patches coming soon. llvm-svn: 160053
* Properly update the FormattedArgs vector when the template type diffing fallsRichard Trieu2012-07-101-0/+9
| | | | | | back to regular type printing. llvm-svn: 159976
* Update the %diff modifer to have an alternate string print when a template treeRichard Trieu2012-06-291-7/+11
| | | | | | | | | | is selected. This will allow more flexibility when converting diagnostics to use template type diffing. Also updated the internal manual and test cases for correctly keeping the bold attribute and for tree printing. llvm-svn: 159463
* Add template type diffing to Clang. This feature will provide a betterRichard Trieu2012-06-261-1/+78
| | | | | | | | | | | | 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
* Documentation cleanup: delete doc comments from source files where they areJames Dennett2012-06-151-6/+0
| | | | | | broken duplicates of comments that are in the corresponding header files. llvm-svn: 158550
* [Basic] Fix up DiagnosticBuilder::{FlushCounts,Emit} to be inline.Daniel Dunbar2012-03-131-23/+6
| | | | | | | | | | | | | | | | - This is much more important than it appears at first glance... The intended design of DiagnosticBuilder was that it never escape and that all its members would get lowered to registers by the compiler. By fixing Emit here, the compiler can completely eliminate the DiagnosticBuilder object and never need to push those registers back into it. Unfortunately, Sema has broken DiagnosticBuilder in other ways (by introducing SemaDiagnosticBuilder), so we don't get the fill impact of this, but it is still good for 30k reduction in code size. I'll work on fixing the SemaDiagnosticBuilder problems next. llvm-svn: 152669
* [Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary sizeDaniel Dunbar2012-03-131-3/+6
| | | | | | | | | | by ~%.3/~100k in my build -- simply by eliminating the horrible code bloat coming from the .clear() of the SmallVector<FixItHint>, which does a std::~string, etc. - My understanding is we don't ever emit arbitrary numbers of fixits, so I just moved us to using a statically sized array like we do for arguments and ranges. llvm-svn: 152639
* More ArrayRef-ification of methods.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151152
* 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 indentation and an 80-column violation.Chad Rosier2012-02-071-5/+7
| | | | llvm-svn: 150010
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-2/+2
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
* In r149662, setDiagnosticMapping was modified to not allow warnings mapped to Chad Rosier2012-02-071-0/+35
| | | | | | | | MAP_ERROR to be remapped to MAP_WARNING. These new APIs are being added to allow the diagnostic mapping's "no Werror" bit to be set, and potentially downgrade anything already mapped to be a warning. llvm-svn: 150001
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-1/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Move Storage and StorageAllocator out of the PartialDiagnostic class so we ↵Benjamin Kramer2012-02-041-2/+2
| | | | | | | | | can forward declare them. Let ASTContext allocate the storage in its BumpPtrAllocator. This will help us remove ASTContext's depedency on PartialDiagnostic.h soon. llvm-svn: 149780
* Change the fixed array of FixitHints to a SmallVector to lift offArgyrios Kyrtzidis2012-02-031-6/+2
| | | | | | the limit on the number of fixits. llvm-svn: 149676
* [frontend] Don't allow a mapping to a warning override an error/fatal mapping.Chad Rosier2012-02-031-0/+7
| | | | | | rdar://10736625 llvm-svn: 149662
* DiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,Argyrios Kyrtzidis2012-01-281-3/+1
| | | | | | caught by Chad. llvm-svn: 149173
* Due to a bug, -Wno-everything works like -Weverything. Fix the bug by havingArgyrios Kyrtzidis2012-01-271-0/+14
| | | | | | | | | -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
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-161-0/+1
| | | | | | | | | | 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
* [PCH] Fix reading from PCH of diagnostic pragmas.Argyrios Kyrtzidis2011-11-091-10/+1
| | | | | | | | | | | In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations leading to crash because the main FileID was not yet initialized. Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking invariants. Fix this by having the ASTReader set up the internal state directly. llvm-svn: 144153
OpenPOWER on IntegriCloud