[cfe-commits] r49177 - in /cfe/trunk: include/clang/Basic/SourceLocation.h lib/Basic/SourceLocation.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 3 10:55:15 PDT 2008


Author: kremenek
Date: Thu Apr  3 12:55:15 2008
New Revision: 49177

URL: http://llvm.org/viewvc/llvm-project?rev=49177&view=rev
Log:
Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.

Modified:
    cfe/trunk/include/clang/Basic/SourceLocation.h
    cfe/trunk/lib/Basic/SourceLocation.cpp

Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=49177&r1=49176&r2=49177&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Thu Apr  3 12:55:15 2008
@@ -234,8 +234,11 @@
   FullSourceLoc getLogicalLoc();
   FullSourceLoc getIncludeLoc();
 
-  unsigned getLineNumber();
-  unsigned getColumnNumber();
+  unsigned getLineNumber() const;
+  unsigned getColumnNumber() const;
+  
+  unsigned getLogicalLineNumber() const;
+  unsigned getLogicalColumnNumber() const;
 
   const char *getCharacterData() const;
   

Modified: cfe/trunk/lib/Basic/SourceLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceLocation.cpp?rev=49177&r1=49176&r2=49177&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/SourceLocation.cpp (original)
+++ cfe/trunk/lib/Basic/SourceLocation.cpp Thu Apr  3 12:55:15 2008
@@ -48,16 +48,27 @@
   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);





More information about the cfe-commits mailing list