Teach the stmtdumper to dump location/range info when a SourceMgr is available.
For example, -parse-ast-dump now prints:

static inline int __inline_isinff(float __x)
(CompoundStmt 0x2409a20
  (ReturnStmt 0x2409a10
    (BinaryOperator 0x24099f0 'int' <///usr/include/architecture/i386/math.h:183:63, col:102> '=='
      (CallExpr 0x24098f0 'float' <col:63, col:82>
        (ImplicitCastExpr 0x24098e0 'float (*)(float)' <col:63>
          (DeclRefExpr 0x2409880 'float (float)' <col:63> Decl='__builtin_fabsf' 0x2409840))
        (DeclRefExpr 0x24098a0 'float' <col:79> Decl='__x' 0x2409810))
      (CallExpr 0x24099c0 'float' <col:87, col:102>
        (ImplicitCastExpr 0x2409870 'float (*)(void)' <col:87>
          (DeclRefExpr 0x2409980 'float (void)' <col:87> Decl='__builtin_inff' 0x2409940))))))

where it only prints filename/line# if it changes from the previous value.  We 
really need loc info on stmts though, like we have on exprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41602 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed