summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/DiagnosticIDs.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Make getDiagnosticsInGroup helper method a static function in the cpp file ↵Craig Topper2013-08-291-15/+16
| | | | | | and move the WarningOption struct into an anonymous namespace instead of clang namespace since it no longer needs to be forward declared in the header. llvm-svn: 189569
* Move individual group name strings from the OptionTable into one big char ↵Craig Topper2013-08-291-14/+11
| | | | | | array. Then only store offsets into it in the OptionTable. Saves about 4K from the clang binary and removes 400 relocation entries from DiagnosticIDs.o. llvm-svn: 189568
* Reorder and shrink size of NameLen field in diagnostic group table. Shaves ↵Craig Topper2013-08-281-5/+4
| | | | | | ~4K from clang binary. llvm-svn: 189445
* Merge diagnostic group tables to reduce data size and relocation entries.Craig Topper2013-08-281-10/+8
| | | | | | | | The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed. My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o. llvm-svn: 189438
* Replace 'unsigned short' with 'uint16_t' in a packed data structure for ↵Craig Topper2013-07-211-1/+1
| | | | | | consistency with other fields and to be explicit about bit count. llvm-svn: 186796
* Revert r186649 because it wasn't unnecessary and add a comment.Craig Topper2013-07-211-7/+11
| | | | llvm-svn: 186795
* DiagnosticIDs: Forbid Diag ID from being validDavid Majnemer2013-07-201-8/+4
| | | | | | | | | | Diag ID is used throughout clang as a sentinel id meaning "this is an invalid diagnostic id." Confusingly, Diag ID maps to a valid, usable, diagnostic id. Instead, start diagnostic ids at ID one. Incidently, remove an unused element from StaticDiagInfo. llvm-svn: 186760
* Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.Craig Topper2013-07-191-11/+7
| | | | llvm-svn: 186649
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-4/+4
| | | | llvm-svn: 186300
* Fix typos: [Dd]iagnosic -> [Dd]iagnosticStefanus Du Toit2013-03-011-3/+3
| | | | | | These all appear in comments or (ironically) diagnostics output. llvm-svn: 176383
* 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
OpenPOWER on IntegriCloud