From 1758b07ef7c554b06c48a43df2edaba85e918031 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 3 Apr 2008 17:55:15 +0000 Subject: [PATCH] Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49177 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceLocation.h | 7 +++++-- 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); -- 2.40.0