summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Eliminate post-diagnostic hooks. Instead, implement a Sema-specificDouglas Gregor2009-03-201-10/+0
| | | | | | | variant of DiagnosticBuilder that emits the template instantiation backtrace when needed. llvm-svn: 67413
* Bindir and Win32 builds work, so switch to .inc files. Leave the .def files ↵Sebastian Redl2009-03-191-16/+16
| | | | | | in the tree for a day or so longer. llvm-svn: 67346
* Allow notes to be printed following a fatal error, then suppress anyDouglas Gregor2009-03-191-12/+17
| | | | | | | | | | diagnostics following those notes. Make exceeding the template instantiation depth a fatal error. Thanks to Daniel for pointing out the problem! llvm-svn: 67320
* Revert the switch to the tablegen diags. It fails for seperate objdir builds ↵Sebastian Redl2009-03-141-16/+16
| | | | | | and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it. llvm-svn: 67009
* Switch diagnostics from .def to tablegen files. Please validate the Windows ↵Sebastian Redl2009-03-141-16/+16
| | | | | | build. llvm-svn: 67007
* Add Diagnostic files for Frontend and move a couple errors over.Daniel Dunbar2009-03-121-2/+14
| | | | | | | - Notably, clang now exits with an error if it can't find a file. This flushed out a bug in the CGColorSpace.c test case. :) llvm-svn: 66789
* Driver: Use standard Diagnostic interface for diagnostics.Daniel Dunbar2009-03-121-2/+14
| | | | llvm-svn: 66786
* Add a notion of "post-diagnostic hooks", which are callbacks attachedDouglas Gregor2009-03-101-0/+18
| | | | | | | | | | | | | | | | | to a diagnostic that will be invoked after the diagnostic (if it is not suppressed). The hooks are allowed to produce additional diagnostics (typically notes) that provide more information. We should be able to use this to help diagnostic clients link notes back to the diagnostic they clarify. Comments welcome; I'll write up documentation and convert other clients (e.g., overload resolution failures) if there are no screams of protest. As the first client of post-diagnostic hooks, we now produce a template instantiation backtrace when a failure occurs during template instantiation. There's still more work to do to make this output pretty, if that's even possible. llvm-svn: 66557
* Revert my last couple patches until I can get them to not make the tests fail.Ted Kremenek2009-03-071-8/+0
| | | | llvm-svn: 66317
* Teach Diagnostic about Selector.Ted Kremenek2009-03-071-0/+8
| | | | llvm-svn: 66314
* replace a dirty hack with a clean solution. Too bad we can't Chris Lattner2009-02-191-1/+3
| | | | | | use Blocks for our callbacks ;-) llvm-svn: 65083
* Fix a long standard problem with clang retaining "too much" sugar Chris Lattner2009-02-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | information about types. We often print diagnostics where we say "foo_t" is bad, but the user doesn't know how foo_t is declared (because it is a typedef). Fix this by expanding sugar when present in a diagnostic (and not one of a few special cases, like vectors). Before: t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)') MAX(P, F); ^~~~~~~~~ t.m:1:78: note: instantiated from: #define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) ^ After: t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float')) MAX(P, F); ^~~~~~~~~ t.m:1:78: note: instantiated from: #define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) ^ llvm-svn: 65081
* fix a minor bug with my previous patchChris Lattner2009-02-171-1/+3
| | | | llvm-svn: 64747
* fix notes so that they are always filtered with the same logic Chris Lattner2009-02-171-45/+79
| | | | | | | | | as the last non-note diagnostic that preceeded them. This ensures that diagnostics in main files which have notes with locations in system headers get all the bits and pieces emitted or not in a unit. This fixes PR3215. llvm-svn: 64746
* don't emit any diagnostics after a fatal one.Chris Lattner2009-02-061-1/+9
| | | | llvm-svn: 63914
* add support to the diagnostics machinery for mapping warnings andChris Lattner2009-02-051-0/+5
| | | | | | errors to 'fatal' error severity. llvm-svn: 63894
* Some name-lookup-related fixes, from Piotr Rak!Douglas Gregor2009-02-041-0/+1
| | | | | | | | | | | | | - Changes Lookup*Name functions to return NamedDecls, instead of Decls. Unfortunately my recent statement that it will simplify lot of code, was not quite right, but it simplifies some... - Makes MergeLookupResult SmallPtrSet instead of vector, following Douglas suggestions. - Adds %qN format for printing qualified names to Diagnostic. - Avoids searching for using-directives in Scopes, which are not DeclScope, during unqualified name lookup. llvm-svn: 63739
* next round of diagnostics cleanups, moving some Chris Lattner2009-01-291-26/+26
| | | | | | | diags around, eliminating #defines, etc. Patch by Anders Johnsen! llvm-svn: 63318
* Fix -Wimplicit-function-declaration, which required some refactoring andChris Lattner2009-01-291-27/+10
| | | | | | changes in various diagnostics code. llvm-svn: 63282
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-8/+91
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Added virtual method DiagnosticClient::IncludeInDiagnosticCounts(). This is ↵Ted Kremenek2009-01-231-1/+7
| | | | | | | | used by Diagnostics to determine if a diagnostic sent to a given DiagnosticClient should be included in the count of diagnostics. The default implementation of this method returns 'true'. Implemented DiagCollector::IncludeInDiagnosticCounts() to return 'false' so that the batching of diagnostics for use with BugReporter doesn't mess up the count of real diagnostics. llvm-svn: 62873
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-1/+1
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* Fix order of evaluation.Sebastian Redl2008-11-271-1/+1
| | | | llvm-svn: 60160
OpenPOWER on IntegriCloud