summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/DiagnosticIDs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-7/+5
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* DiagnosticIds: Fix offset/ID calculation, no impact outside this code.Argyrios Kyrtzidis2013-01-021-2/+4
| | | | | | | | | | | | Patch by Will Dietz: Minor touchup so the values of Offset/ID reflect their intention. Previously, the sum (Offset+ID) was correct, but Offset/ID individually were wrong. Caught by investigating unsigned overflow reported by -fsanitize=integer. llvm-svn: 171421
* Speed up looking up static diagnostic infos.Benjamin Kramer2012-12-111-8/+41
| | | | | | | | | | | Instead of doing a binary search over the whole diagnostic table (which weighs a whopping 48k on x86_64), use the existing enums to compute the index in the table. This avoids loading any unneeded data from the table and avoids littering CPU caches with it. This code is in a hot path for code with many diagnostics. 1% speedup on -fsyntax-only gcc.c, which emits a lot of warnings. llvm-svn: 169890
* Fix analysis based warnings so that all warnings are emitted when compilingDeLesley Hutchins2012-12-071-0/+4
| | | | | | | | | 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/+0
| | | | | | | | | | | | | 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
* Set Diag.ErrorOccurred even if a DiagnosticConsumer does not want it inDaniel Jasper2012-09-281-3/+2
| | | | | | | | | | | diagnostic count. If a DiagnosticConsumer sub-class overwrites IncludeInDiagnosticCounts, this should change diagnostic counts. However, it currently also influences Diag.ErrorOccurred, which in turn influences the behavior of parsing and semantic analysis (in a way that can make it crash). llvm-svn: 164824
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). llvm-svn: 160078
* Emit -verify diagnostics even when we have a fatal error.Jordan Rose2012-07-111-20/+11
| | | | | | | | | | | | | | 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
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-13/+0
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
* Provide common include for all diagnostic headers.David Blaikie2012-02-151-17/+1
| | | | | | Reviewed by Ted Kremenek. llvm-svn: 150616
* Store the warning option corresponding to a diagnostics as an index into the ↵Benjamin Kramer2012-02-151-21/+16
| | | | | | | | option table instead of storing the name. Another 8 bytes + relocation removed from every diagnostic on x86_64. llvm-svn: 150615
* Remove the unuseful -fdiagnostics-show-nameDavid Blaikie2012-02-151-95/+4
| | | | | | | | | | | | | | This option was added in r129614 and doesn't have any use case that I'm aware of. It's possible that external tools are using these names - and if that's the case we can certainly reassess the functionality, but for now it lets us shave out a few unneeded bits from clang. Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool. This removes the actual diagnostic name strings from clang entirely. Reviewed by Chris Lattner & Ted Kremenek. llvm-svn: 150612
* Kill the brief and full explanation fields from StaticDiagInfoRec. They were ↵Benjamin Kramer2012-02-091-32/+5
| | | | | | | | unused and wasted space for nothing. - per PR11952. llvm-svn: 150199
* Change the fixed array of FixitHints to a SmallVector to lift offArgyrios Kyrtzidis2012-02-031-2/+2
| | | | | | the limit on the number of fixits. llvm-svn: 149676
* Due to a bug, -Wno-everything works like -Weverything. Fix the bug by havingArgyrios Kyrtzidis2012-01-271-0/+6
| | | | | | | | | -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
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-1/+0
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Separate the serialization library's diagnostics from the frontend'sChandler Carruth2011-12-091-0/+2
| | | | | | | diagnostics. Conflating them was highly confusing and makes it harder to establish a firm layering separation between these two libraries. llvm-svn: 146207
* Fix some possible gcc-4.2 may be used uninitialized warnings.Daniel Dunbar2011-11-281-1/+1
| | | | llvm-svn: 145293
* Warning option typo correction: When two options have the same edit_distance ↵Benjamin Kramer2011-11-151-4/+6
| | | | | | | | 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-0/+21
| | | | | | | $ clang -Wololo t.c warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option] llvm-svn: 144591
* Further refine the diagnostic categories for ARC diagnostics. Addresses ↵Ted Kremenek2011-10-201-2/+7
| | | | | | <rdar://problem/10245086>. llvm-svn: 142571
* Change __extension__ to disable only diagnostics controlled by -pedantic.Bob Wilson2011-10-121-3/+6
| | | | | | | | | | | | This changes clang to match GCC's behavior for __extension__, which temporarily disables the -pedantic flag. Warnings that are enabled without -pedantic are not affected. Besides the general goodness of matching GCC's precedent, my motivation for this is that macros in the arm_neon.h header need to use __extension__ to avoid pedantic complaints about their use of statement expressions, yet we still want to warn about incompatible pointer arguments for those macros. llvm-svn: 141804
* Basic/Diagnostic: Kill off a few unnecessary functions now that refactoring ↵Daniel Dunbar2011-09-291-7/+5
| | | | | | is done, and add a note that the new setDiagnosticGroup{...} methods only operate on the current diagnostic state. llvm-svn: 140771
* Basic/Diagnostics: Rewrite DiagnosticIDs::getDiagnosticLevel completely to ↵Daniel Dunbar2011-09-291-67/+48
| | | | | | | | be straighter line code, use the new DiagnosticMappingInfo flags, and eliminate the odd MAP_WARNING_NO_WERROR and friend mappings. - This fixes a host of obscure bugs with regards to how warning mapping options composed with one another, and I believe makes the code substantially easier to read and reason about. llvm-svn: 140770
* Basic/Diagnostics: Add three explicit bits to DiagnosticMappingInfo to track ↵Daniel Dunbar2011-09-291-17/+20
| | | | | | | | "no-warning-as-error", "no-error-as-fatal", and "show-in-system-header", and update DiagnosticsEngine::setDiagnosticGroup{WarningAsError,ErrorAsFatal} and GetDefaultDiagMappingInfo to set them appropriately. - No actual functionality change for now, we still also use the diag::Mapping::{MAP_WARNING_NO_ERROR,MAP_ERROR_NO_FATAL,MAP_WARNING_SHOW_IN_SYSTEM_HEADER} for a little while longer. llvm-svn: 140768
* Basic/Diagnostics: Add a DiagnosticIDs::getDiagnosticsInGroup method, and useDaniel Dunbar2011-09-291-39/+27
| | | | | | | that in DiagnosticEngine instead of the convoluted calling into DiagnosticIDs which then calls back into the DiagnosticsEngine. llvm-svn: 140766
* Basic/Diagnostic: Add a DiagSate::getOrAddMappingInfo method.Daniel Dunbar2011-09-291-7/+22
| | | | | | - Also, spell const_iterator as const_iterator. llvm-svn: 140765
* Basic/Diagnostics: Add a DiagnosticMappingInfo helper class, and switch toDaniel Dunbar2011-09-291-10/+11
| | | | | | | storing mappings with that instead of straying some magic constants about the source. llvm-svn: 140760
* Basic/Diagnostics: Eliminate getDiagnosticMappingInfo method, which wasn't ↵Daniel Dunbar2011-09-291-2/+1
| | | | | | worth methodizing. llvm-svn: 140759
* Basic/Diagnostic: Eliminate the extra "mapping" out-parameter now that I ↵Daniel Dunbar2011-09-291-8/+3
| | | | | | killed the sole client. llvm-svn: 140756
* Basic/Diagnostics: Add an isDefaultMappingAsError method, and switch ↵Daniel Dunbar2011-09-291-0/+7
| | | | | | | | TextDiagnosticPrinter to use that instead of extracting the current mapping via getDiagnosticLevel, which fixes one class of corner cases w.r.t. printing the "-Werror" diagnostic option marker. - The TextDiagnosticPrinter code is still fragile as it is just "reverse engineering" what the diagnostic engine is doing. Not my current priority to fix though. llvm-svn: 140752
* Basic/Diagnostics: Split out the default warning "no-Werror" andDaniel Dunbar2011-09-291-6/+26
| | | | | | | "show-in-system-header" bits, which is part of teasing them apart from the diagnostic mapping kind. llvm-svn: 140742
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-261-1/+1
| | | | llvm-svn: 140493
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-14/+14
| | | | llvm-svn: 140478
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Implement '-Weverything', which enables all warnings except those explicitly ↵Ted Kremenek2011-08-181-7/+20
| | | | | | | | | | | | | | 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
* Fix -ferror-limit= to properly emit notes following the last errorDouglas Gregor2011-08-171-4/+6
| | | | | | messages. Fi from David Blaikie, tests from Nikola Smiljanic! llvm-svn: 137851
* Fix C++0x narrowing conversion errors in Clang.Jeffrey Yasskin2011-08-131-2/+6
| | | | llvm-svn: 137552
* Provide diag_iterator for iterating over the built-in diagnostic IDs/names ↵Ted Kremenek2011-08-091-0/+29
| | | | | | in the internal table of DiagnosticIDs. llvm-svn: 137108
* Make DiagnosticErrorTrap keep a count of the errors that occurred so multipleArgyrios Kyrtzidis2011-07-291-4/+8
| | | | | | | | DiagnosticErrorTraps can be composed (e.g. a trap inside another trap). Fixes http://llvm.org/PR10462 & rdar://9852007. llvm-svn: 136447
* Clean up as many of the comments in Basic I can find to talk in terms ofChandler Carruth2011-07-261-2/+2
| | | | | | 'expansion' rather than 'instantiation' for macro source locations. llvm-svn: 136058
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-251-1/+1
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-32/+32
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Keep track of when "unrecoverable" errors occur, then allowDouglas Gregor2011-07-061-3/+5
| | | | | | | clang_saveTranslationUnit() to save a PCH file if the only errors it contains are recoverable errors. Fixes <rdar://problem/9727804>. llvm-svn: 134503
* Automatic Reference Counting.John McCall2011-06-151-0/+5
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Generate enumerators for diagnostic categories. Patch by Argyrios!John McCall2011-06-151-1/+23
| | | | | | Depends on LLVM r133093. llvm-svn: 133094
* StaticDiagNameIndex is never written to, place it into .rodata.Benjamin Kramer2011-06-141-2/+2
| | | | llvm-svn: 132990
* Put classes into anonymous namespaces.Benjamin Kramer2011-06-131-20/+26
| | | | llvm-svn: 132924
* A StringRef-ication of the DiagnosticIDs API and internals.Argyrios Kyrtzidis2011-05-251-64/+121
| | | | | | | | | 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
OpenPOWER on IntegriCloud