summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnosticPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* make "in included from" and "in instatiation from" messages respectChris Lattner2009-04-211-9/+15
| | | | | | -fno-show-location, patch by Alexei Svitkine (PR4024) llvm-svn: 69657
* don't crash on invalid ranges in -fprint-source-range-infoChris Lattner2009-04-191-0/+3
| | | | | | mode, just ignore them as usual. llvm-svn: 69558
* implement compiler support for -fno-diagnostics-fixit-info,Chris Lattner2009-04-191-3/+2
| | | | | | rdar://6805442 llvm-svn: 69525
* tblgen is now passing diagnostic group information in the .inc file, ignore ↵Chris Lattner2009-04-161-1/+1
| | | | | | it everywhere. llvm-svn: 69269
* implement framework for -fdiagnostics-show-option, but tblgen isn'tChris Lattner2009-04-161-0/+5
| | | | | | passing down the right info yet. llvm-svn: 69268
* Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner2009-04-141-2/+2
| | | | | | | | | | | | | | | | | | This allows it to accurately measure tokens, so that we get: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~~^ instead of the woefully inferior: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ Most of this is just plumbing to push the reference around. llvm-svn: 69099
* implement a new -fprint-source-range-info option, whichChris Lattner2009-03-131-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defaults to off. When enabled, it emits range info along with the file/line/col information for a diagnostic. This allows tools that textually parse the output of clang to know where the ranges are, even if they span multiple lines. For example, with: $ clang exprs.c -fprint-source-range-info We now produce: exprs.c:21:11:{21:12-21:13}: warning: use of unary operator that may be intended as compound assignment (+=) var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}} ^~ exprs.c:22:11:{22:12-22:13}: warning: use of unary operator that may be intended as compound assignment (-=) var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}} ^~ exprs.c:36:13:{36:3-36:12}: error: assignment to cast is illegal, lvalue casts are not supported (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} ~~~~~~~~~ ^ exprs.c:41:4:{41:3-41:4}: error: called object type 'int' is not a function or function pointer X(); // expected-error {{called object type 'int' is not a function or function pointer}} ~^ exprs.c:45:15:{45:8-45:14}{45:17-45:24}: error: invalid operands to binary expression ('int *' and '_Complex float') P = (P-42) + Gamma*4; // expected-error {{invalid operands to binary expression ('int *' and '_Complex float')}} ~~~~~~ ^ ~~~~~~~ exprs.c:61:7:{61:16-61:22}: error: invalid application of '__alignof' to bitfield R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} ^ ~~~~~~ Note the range info after the column in the initial diagnostic. This is obviously really annoying if you're not a tool parsing the output of clang, which is why it is off by default. llvm-svn: 66862
* Extend the notion of active template instantiations to include theDouglas Gregor2009-03-101-4/+8
| | | | | | | | | | | | context of a template-id for which we need to instantiate default template arguments. In the TextDiagnosticPrinter, don't suppress the caret diagnostic if we are producing a non-note diagnostic that follows a note diagnostic with the same location, because notes are (conceptually) a part of the warning or error that comes before them. llvm-svn: 66572
* generalize the "end of line" checking logic to stop at any \0 at theChris Lattner2009-03-081-3/+1
| | | | | | | | | end of line instead of just the end of buffer. Scratch buffers contain embedded \0's between tokens which are logic line separators. If a normal text buffer contains \0's, it doesn't make a lot of sense to include them in the caret diag output anyway. llvm-svn: 66374
* fix PR2639Chris Lattner2009-03-021-1/+1
| | | | llvm-svn: 65869
* Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*Daniel Dunbar2009-03-021-0/+315
driver taking lib/Driver. llvm-svn: 65811
OpenPOWER on IntegriCloud