Граф коммитов

17 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 61dc71ab04 Plist diagnostics: distinguish between regular and extended messages for "events".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19 00:42:56 +00:00
Douglas Gregor a393e9eedc Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

  - We don't remove or use the current ".def" files. Instead, for now,
    we just make sure that we're building the ".inc" files.
  - Fixed CMake makefiles to run TableGen and build the ".inc" files
    when needed. Tested with both the Xcode and Makefile generators
    provided by CMake, so it should be solid.
  - Fixed normal makefiles to handle out-of-source builds that involve
    the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 23:06:59 +00:00
Chris Lattner 1fbee5d028 implement a new -fprint-source-range-info option, which
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 01:08:23 +00:00
Ted Kremenek 082cb8d7bd PathDiagnostics:
- PathDiagnosticControlFlowPiece now consists of a "start" and "end" location
  to indicating the branch location and where the branch goes.

BugReporter:
- Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with
  "end" locations.

PlistDiagnostics:
- Plists now contain the bug "type" (not just bug "category")
- Plists now encode control-flow pieces differently than events; now the
  "start" and "end" locations are recorded


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 18:41:53 +00:00
Douglas Gregor df667e71b1 Extend the notion of active template instantiations to include the
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 20:44:00 +00:00
Ted Kremenek 0e5c8d4ca6 BugReporter:
- Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces.
- Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that
  contain no informative events.

HTMLDiagnostics:
- Use new information about PathDiagnosticMacroPieces to specially format
  message bubbles for macro expansions containing interesting events.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 05:16:17 +00:00
Ted Kremenek 0008683bee Handle "Macro" PathDiagnosticPiece kind when getting string identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 02:49:29 +00:00
Chris Lattner cd1148b614 generalize the "end of line" checking logic to stop at any \0 at the
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 08:11:22 +00:00
Ted Kremenek 4e25ee3b12 Resize message bubble back to original size.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:06:15 +00:00
Ted Kremenek 80bae763da Adjust HTML message bubbles to utilize information from PathDiagnosticPiece::Kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:05:40 +00:00
Chris Lattner 3daed52a57 improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:20:04 +00:00
Ted Kremenek ae3487f787 Plist diagnostics now include PathDiagnostPiece::Kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 21:44:02 +00:00
Ted Kremenek 2f10398814 Update HTML diagnostics to honor the different between 'event' and 'control-flow' diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 21:42:01 +00:00
Chris Lattner 7b5b5b4409 fix PR2639
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 20:58:48 +00:00
Daniel Dunbar 4ad19bf5b9 Fix name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 19:50:00 +00:00
Ted Kremenek 3d7f2bc5a5 For now, do not output the 'DisplayHint' in plist files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 19:40:15 +00:00
Daniel Dunbar e1bd4e6d7c Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*
driver taking lib/Driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 06:16:29 +00:00