summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* add clang -cc1 level support for "-ferror-limit 42"Chris Lattner2010-04-071-2/+2
| | | | llvm-svn: 100687
* add capabilities to stop emitting errors after some limit.Chris Lattner2010-04-071-0/+7
| | | | | | Right now the limit is 0 (aka disabled) llvm-svn: 100684
* Instead of counting totally diagnostics, split the count into a countChris Lattner2010-04-071-2/+5
| | | | | | | | | | | | | | | of errors and warnings. This allows us to emit something like this: 2 warnings and 1 error generated. instead of: 3 diagnostics generated. This also stops counting 'notes' because they are just follow-on information about the previous diag, not a diagnostic in themselves. llvm-svn: 100675
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-5/+5
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-5/+5
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-5/+5
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor2010-03-291-0/+11
| | | | | | | | | | | | | | cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. llvm-svn: 99849
* Teach the diagnostic engine to provide more detailed information aboutDouglas Gregor2010-03-251-4/+14
| | | | | | | | | how to handle a diagnostic during template argument deduction, which may be "substitution failure", "suppress", or "report". This keeps us from, e.g., emitting warnings while performing template argument deduction. llvm-svn: 99560
* Fix a thinko and a typo in the delayed-diagnostic code.Douglas Gregor2010-03-221-3/+4
| | | | llvm-svn: 99178
* Introduce the notion of a single "delayed" diagnostic into theDouglas Gregor2010-03-221-0/+47
| | | | | | | | | | | | Diagnostic subsystem, which is used in the rare case where we find a serious problem (i.e., an inconsistency in the file system) while we're busy formatting another diagnostic. In this case, the delayed diagnostic will be emitted after we're done with the other diagnostic. This is only to be used for fatal conditions detected at very inconvenient times, where we can neither stop the current diagnostic in flight nor can we suppress the second error. llvm-svn: 99175
* Use a little binary header in serialized diagnostics to help the ↵Douglas Gregor2010-02-191-3/+26
| | | | | | deserializer skip over noise in the stream llvm-svn: 96641
* Re-apply my diagnostics-capture patch for CIndex, with some tweaks toDouglas Gregor2010-02-181-1/+1
| | | | | | try to address the msvc failures. llvm-svn: 96624
* Rework how CIndex handles diagnostics. Rather than using a callback,Douglas Gregor2010-02-181-142/+168
| | | | | | | | | | | | | | | | | | we attach diagnostics to translation units and code-completion results, so they can be queried at any time. To facilitate this, the new StoredDiagnostic class stores a diagnostic in a serializable/deserializable form, and ASTUnit knows how to capture diagnostics in this stored form. CIndex's CXDiagnostic is a thin wrapper around StoredDiagnostic, providing a C interface to stored or de-serialized diagnostics. I've XFAIL'd one test case temporarily, because currently we end up storing diagnostics in an ASTUnit that's never returned to the user (because it contains errors). I'll introduce a temporary fix for this soon; the real fix will be to allow us to return and query invalid ASTs. llvm-svn: 96592
* Suppress warnings if their instantiation location is in a system header, notJohn McCall2010-02-111-1/+1
| | | | | | | | | | | | | their spelling location. This prevents warnings from being swallowed just because the caret is on the first parenthesis in, say, NULL. This is an experiment; the risk is that there might be a substantial number of system headers which #define symbols to expressions which inherently cause warnings. My theory is that that's rare enough that it can be worked around case-by-case, and that producing useful warnings around NULL is worth it. But I'm willing to accept that I might be empirically wrong. llvm-svn: 95870
* Introduce serialization and deserialization of diagnostic informationDouglas Gregor2010-01-281-0/+217
| | | | | | | | | | | | | | | | | so that CIndex can report diagnostics through the normal mechanisms even when executing Clang in a separate process. This applies both when performing code completion and when using ASTs as an intermediary for clang_createTranslationUnitFromSourceFile(). The serialized format is not perfect at the moment, because it does not encapsulate macro-instantiation information. Instead, it maps all source locations back to the instantiation location. However, it does maintain source-range and fix-it information. To get perfect fidelity from the serialized format would require serializing a large chunk of the source manager; at present, it isn't clear if this code will live long enough for that to matter. llvm-svn: 94740
* Pre-emptive bugfixes in the diagnostics code: allow arbitrary punctuationJohn McCall2010-01-141-8/+35
| | | | | | | characters to be escaped and implement a scan-forward function which properly respects brace nesting. llvm-svn: 93447
* Add the %ordinal format modifier for turning '1' into '1st'. Hard-coded forJohn McCall2010-01-141-0/+35
| | | | | | | English right now; would not be impossible to grab a special format string from the diagnostic pool and localize that way. llvm-svn: 93390
* Perform format-expansion on %select results.John McCall2010-01-131-5/+13
| | | | llvm-svn: 93377
* implement -W[no-]fatal-errors, patch by Christian Adåker!Chris Lattner2009-12-221-0/+13
| | | | llvm-svn: 91938
* Remove 'LangOpts' from Diagnostic (added in ↵Steve Naroff2009-12-051-1/+0
| | | | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=90642). Simply use the 'LangOpts' member already present in TextDiagnosticPrinter. Sorry for the confusion! llvm-svn: 90664
* Integrate the following from the 'objective-rewrite' branch:Steve Naroff2009-12-051-1/+2
| | | | | | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=71086 Note - This commit only includes the fix for: <rdar://problem/6309338> slightly different error message format for Visual Studio. The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming. llvm-svn: 90642
* Convert Diagnostic::getCustomDiagID to take a StringRef.Daniel Dunbar2009-12-011-2/+2
| | | | llvm-svn: 90244
* Fixed undefined behavior in pushMappings when the stack has to resize.John Thompson2009-10-231-0/+2
| | | | llvm-svn: 84924
* teach FormatDiagnostic to aggregate previously formatted arguments andChris Lattner2009-10-201-3/+25
| | | | | | | | | pass them down into the ArgToStringFn implementation. This allows redundancy across operands to a diagnostic to be eliminated. This isn't used yet, so no functionality change. llvm-svn: 84602
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Use raw_ostream for formatting integers, and use IdentifierInfo::getNameStrDaniel Dunbar2009-10-171-10/+4
| | | | | | | instead of getName. - -2 FIXMEs. llvm-svn: 84337
* increase helpfulness of assert message.Chris Lattner2009-10-161-1/+6
| | | | llvm-svn: 84240
* Unify our diagnostic printing for errors of the form, "we didn't likeDouglas Gregor2009-10-131-0/+1
| | | | | | | | | | what we found when we looked into <blah>", where <blah> is a DeclContext*. We can now format DeclContext*'s in nice ways, e.g., "namespace N", "the global namespace", "'class Foo'". This is part of PR3990, but we're not quite there yet. llvm-svn: 84028
* Initial implementation of a code-completion interface in Clang. InDouglas Gregor2009-09-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | essence, code completion is triggered by a magic "code completion" token produced by the lexer [*], which the parser recognizes at certain points in the grammar. The parser then calls into the Action object with the appropriate CodeCompletionXXX action. Sema implements the CodeCompletionXXX callbacks by performing minimal translation, then forwarding them to a CodeCompletionConsumer subclass, which uses the results of semantic analysis to provide code-completion results. At present, only a single, "printing" code completion consumer is available, for regression testing and debugging. However, the design is meant to permit other code-completion consumers. This initial commit contains two code-completion actions: one for member access, e.g., "x." or "p->", and one for nested-name-specifiers, e.g., "std::". More code-completion actions will follow, along with improved gathering of code-completion results for the various contexts. [*] In the current -code-completion-dump testing/debugging mode, the file is truncated at the completion point and EOF is translated into "code completion". llvm-svn: 82166
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-49/+49
| | | | llvm-svn: 81346
* Improve diagnostics and recovery when the nested-name-specifier of aDouglas Gregor2009-08-261-0/+1
| | | | | | | | | | | | qualified name does not actually refer into a class/class template/class template partial specialization. Improve printing of nested-name-specifiers to eliminate redudant qualifiers. Also, make it possible to output a nested-name-specifier through a DiagnosticBuilder, although there are relatively few places that will use this leeway. llvm-svn: 80056
* add push/pop semantics for diagnostics. Patch by Louis Gerbarg!Chris Lattner2009-07-121-1/+16
| | | | llvm-svn: 75431
* Base SFINAE error suppression counting on the class of an error, notDouglas Gregor2009-06-151-1/+1
| | | | | | its (possibly-remapped) diagnostics. Thanks, Chris! llvm-svn: 73390
* Update LLVM.Douglas Gregor2009-06-141-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement support for C++ Substitution Failure Is Not An Error (SFINAE), which says that errors that occur during template argument deduction do *not* produce diagnostics and do not necessarily make a program ill-formed. Instead, template argument deduction silently fails. This is currently implemented for template argument deduction during matching of class template partial specializations, although the mechanism will also apply to template argument deduction for function templates. The scheme is simple: - If we are in a template argument deduction context, any diagnostic that is considered a SFINAE error (or warning) will be suppressed. The error will be propagated up the call stack via the normal means. - By default, all warnings and errors are SFINAE errors. Add the NoSFINAE class to a diagnostic in the .td file to make it a hard error (e.g., for access-control violations). Note that, to make this fully work, every place in Sema that emits an error *and then immediately recovers* will need to check Sema::isSFINAEContext() to determine whether it must immediately return an error rather than recovering. llvm-svn: 73332
* when creating custom warning diagnostics, do not attempt to mapChris Lattner2009-05-021-5/+0
| | | | | | | | them with -Werror. Custom diags cannot be mapped, and this makes -Werror cause a determinstic crash for the checker and other clients of the custom diagnostics machinery. rdar://6816191 llvm-svn: 70639
* Don't crash in the diagnostic printer if we happen to get passed aDaniel Dunbar2009-04-201-0/+13
| | | | | | null string / identifier. llvm-svn: 69575
* move group twiddling options into Diagnostic.cpp instead ofChris Lattner2009-04-191-0/+58
| | | | | | | Warnings.cpp. Warnings.cpp now doesn't need to #include tblgen produced output directly. llvm-svn: 69559
* optimize and comment GetDiagInfo.Chris Lattner2009-04-161-6/+32
| | | | llvm-svn: 69273
* merge several scattered tables into StaticDiagInfo.Chris Lattner2009-04-161-144/+19
| | | | llvm-svn: 69272
* Implement Diagnostic::getWarningOptionForDiag with information from tblgen,Chris Lattner2009-04-161-10/+19
| | | | | | this implements -fdiagnostics-show-option in clang-cc. llvm-svn: 69271
* tblgen is now passing diagnostic group information in the .inc file, ignore ↵Chris Lattner2009-04-161-3/+4
| | | | | | it everywhere. llvm-svn: 69269
* implement framework for -fdiagnostics-show-option, but tblgen isn'tChris Lattner2009-04-161-0/+7
| | | | | | passing down the right info yet. llvm-svn: 69268
* move handling of -pedantic and -pedantic-errors into Diagnostics,Chris Lattner2009-04-161-3/+20
| | | | | | | out of Warnings.cpp. This simplifies warnings.cpp and makes it more efficient. llvm-svn: 69266
* arrange for -Wno-error=foo warnings to be immune to -Werror as Chris Lattner2009-04-161-1/+14
| | | | | | they are supposed to be. llvm-svn: 69265
* change mappings to distinguish between "unset", "set by the user" and Chris Lattner2009-04-161-7/+23
| | | | | | "set to the default value". llvm-svn: 69264
* fix some out of bounds array access problems, which manifest particularlyChris Lattner2009-04-151-18/+37
| | | | | | spectacularly when built for x86-64. llvm-svn: 69197
* move {'sChris Lattner2009-04-151-6/+3
| | | | llvm-svn: 69179
* Make diagnostic class explicit in the diag record instead ofChris Lattner2009-04-151-16/+14
| | | | | | | implicit from its parenting. Now that diag mapping is explicit, eliminate the fatal and extwarn classes. llvm-svn: 69177
* Tblgen now passes the default mapping explicitly, instead of having it Chris Lattner2009-04-151-20/+3
| | | | | | be tied to the diag class. This requires an LLVM tree update. llvm-svn: 69175
* Rejigger how -pedantic and -pedantic-errors work and their interactionChris Lattner2009-04-151-58/+107
| | | | | | | | | | | | | | | | with other diagnostic mapping. In the new scheme, -Wfoo or -Wno-foo or -Werror=foo all override the -pedantic options, and __extension__ robustly silences all extension diagnostics in their scope. An added bonus of this change is that MAP_DEFAULT goes away, meaning that per-diagnostic mapping information can now be stored in 2 bits, doubling the density of the Diagnostic::DiagMapping array. This also substantially simplifies Diagnostic::getDiagnosticLevel. OTOH, this temporarily introduces some "macro intensive" code in Diagnostic.cpp. This will be addressed in a later patch. llvm-svn: 69154
OpenPOWER on IntegriCloud