diff options
author | Chris Lattner <sabre@nondot.org> | 2008-09-29 21:46:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-09-29 21:46:13 +0000 |
commit | 5c38b6388dc44dcb8467a9e0f22d93db7221717e (patch) | |
tree | 1f535fd4365ff2f3960e82a18af3205284151b76 /include/clang/Basic/SourceLocation.h | |
parent | a09f585a7fdbb01b4bf9de3679fd37005379ca66 (diff) |
Make some methods const, add some helpers to FullSourceLoc,
and add a dump method to FullSourceLoc! Patch by Nico Weber!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceLocation.h')
-rw-r--r-- | include/clang/Basic/SourceLocation.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 145e1c8487..ee6cc145fe 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -87,7 +87,7 @@ public: static bool isValidMacroPhysOffs(int Val) { if (Val >= 0) return Val < (1 << (MacroPhysOffsBits-1)); - return -Val < (1 << (MacroPhysOffsBits-1)); + return -Val <= (1 << (MacroPhysOffsBits-1)); } static SourceLocation getMacroLoc(unsigned MacroID, int PhysOffs){ @@ -231,8 +231,9 @@ public: return *SrcMgr; } - FullSourceLoc getLogicalLoc(); - FullSourceLoc getIncludeLoc(); + FullSourceLoc getLogicalLoc() const; + FullSourceLoc getPhysicalLoc() const; + FullSourceLoc getIncludeLoc() const; unsigned getLineNumber() const; unsigned getColumnNumber() const; @@ -240,6 +241,9 @@ public: unsigned getLogicalLineNumber() const; unsigned getLogicalColumnNumber() const; + unsigned getPhysicalLineNumber() const; + unsigned getPhysicalColumnNumber() const; + const char *getCharacterData() const; const llvm::MemoryBuffer* getBuffer() const; @@ -260,6 +264,10 @@ public: bool operator!=(const FullSourceLoc& RHS) const { return SrcMgr != RHS.SrcMgr || Loc != RHS.Loc; } + + /// Prints information about this FullSourceLoc to stderr. Useful for + /// debugging. + void dump() const; }; } // end namespace clang |