diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:00:02 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:00:02 +0000 | 
| commit | 53e384f6335f5b361d838ab5032cb13d262023e4 (patch) | |
| tree | 273027c121ac46cea71e2d421c267a670e4e5ef9 /clang/lib/AST/StmtDumper.cpp | |
| parent | 2d9e40ed2481b3fc34c747841e5c926b7c67308a (diff) | |
| download | bcm5719-llvm-53e384f6335f5b361d838ab5032cb13d262023e4.tar.gz bcm5719-llvm-53e384f6335f5b361d838ab5032cb13d262023e4.zip  | |
Change some terminology in SourceLocation: instead of referring to 
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
Diffstat (limited to 'clang/lib/AST/StmtDumper.cpp')
| -rw-r--r-- | clang/lib/AST/StmtDumper.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index c3ce92de60b..1ee3efab0a2 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -152,21 +152,22 @@ namespace  {  //===----------------------------------------------------------------------===//  void StmtDumper::DumpLocation(SourceLocation Loc) { -  SourceLocation PhysLoc = SM->getPhysicalLoc(Loc); +  SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);    // The general format we print out is filename:line:col, but we drop pieces    // that haven't changed since the last loc printed. -  const char *Filename = SM->getSourceName(PhysLoc); -  unsigned LineNo = SM->getLineNumber(PhysLoc); +  const char *Filename = SM->getSourceName(SpellingLoc); +  unsigned LineNo = SM->getLineNumber(SpellingLoc); +  unsigned ColNo = SM->getColumnNumber(SpellingLoc);    if (strcmp(Filename, LastLocFilename) != 0) { -    fprintf(stderr, "%s:%u:%u", Filename, LineNo, SM->getColumnNumber(PhysLoc)); +    fprintf(stderr, "%s:%u:%u", Filename, LineNo, ColNo);      LastLocFilename = Filename;      LastLocLine = LineNo;    } else if (LineNo != LastLocLine) { -    fprintf(stderr, "line:%u:%u", LineNo, SM->getColumnNumber(PhysLoc)); +    fprintf(stderr, "line:%u:%u", LineNo, ColNo);      LastLocLine = LineNo;    } else { -    fprintf(stderr, "col:%u", SM->getColumnNumber(PhysLoc)); +    fprintf(stderr, "col:%u", ColNo);    }  }  | 

