diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-03 17:55:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-03 17:55:15 +0000 |
commit | 1758b07ef7c554b06c48a43df2edaba85e918031 (patch) | |
tree | 2dc8a32b90cdc819c2d88d44739f5bd7db7bc8ae | |
parent | 2f2418eacfdc68e09a75f4343ed93ba292e8d895 (diff) |
Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49177 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/SourceLocation.h | 7 | ||||
-rw-r--r-- | lib/Basic/SourceLocation.cpp | 15 |
2 files changed, 18 insertions, 4 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index faa5dc69b8..83633ebf85 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -234,8 +234,11 @@ public: FullSourceLoc getLogicalLoc(); FullSourceLoc getIncludeLoc(); - unsigned getLineNumber(); - unsigned getColumnNumber(); + unsigned getLineNumber() const; + unsigned getColumnNumber() const; + + unsigned getLogicalLineNumber() const; + unsigned getLogicalColumnNumber() const; const char *getCharacterData() const; diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index eaf129f251..c01447567f 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/lib/Basic/SourceLocation.cpp @@ -48,16 +48,27 @@ FullSourceLoc FullSourceLoc::getIncludeLoc() { return FullSourceLoc(SrcMgr->getIncludeLoc(Loc),*SrcMgr); } -unsigned FullSourceLoc::getLineNumber() { +unsigned FullSourceLoc::getLineNumber() const { assert (isValid()); return SrcMgr->getLineNumber(Loc); } -unsigned FullSourceLoc::getColumnNumber() { +unsigned FullSourceLoc::getColumnNumber() const { assert (isValid()); return SrcMgr->getColumnNumber(Loc); } + +unsigned FullSourceLoc::getLogicalLineNumber() const { + assert (isValid()); + return SrcMgr->getLogicalLineNumber(Loc); +} + +unsigned FullSourceLoc::getLogicalColumnNumber() const { + assert (isValid()); + return SrcMgr->getLogicalColumnNumber(Loc); +} + const char* FullSourceLoc::getSourceName() const { assert (isValid()); return SrcMgr->getSourceName(Loc); |