]> granicus.if.org Git - clang/commit
fix a FIXME, providing accurate source range info for DeclStmt's. The end
authorChris Lattner <sabre@nondot.org>
Thu, 2 Apr 2009 04:16:50 +0000 (04:16 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 2 Apr 2009 04:16:50 +0000 (04:16 +0000)
commit97144fc41a9419bf6d74fc9450e8ef3f6e11f7e0
treefa4999c1dd962098ab138210b5268e02b340acbc
parent0ddaff3a558cca0d1157c3f63e3ad82b72cf625a
fix a FIXME, providing accurate source range info for DeclStmt's.  The end
of the range is now the ';' location.  For something like this:

$ cat t2.c

#define bool int
void f(int x, int y) {
bool b = !x && y;
}

We used to produce:
$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
  (DeclStmt 0x2201ef0 <line:2:14>                   <----
    0x2201a20 "int b =
      (BinaryOperator 0x2201ed0 <line:4:10, col:16> 'int' '&&'
        (UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
          (DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
        (DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")

Now we produce:

$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
  (DeclStmt 0x2201ef0 <line:2:14, line:4:17>         <------
    0x2201a20 "int b =
      (BinaryOperator 0x2201ed0 <col:10, col:16> 'int' '&&'
        (UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
          (DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
        (DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68288 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Parser.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseStmt.cpp
lib/Parse/ParseTemplate.cpp
lib/Parse/Parser.cpp