diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-04 01:06:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-04 01:06:56 +0000 |
commit | 30fc933e5fbbb5f0ea60c47976d435254e378536 (patch) | |
tree | 19a0f7e4b89828c3609273aebd49d0ec19d35faf /include/clang/Basic/SourceManager.h | |
parent | e7353a6a5298d49241afaf6da58d79dd25a65c66 (diff) |
lower the interface to getLineNumber like we did for
getColumnNumber. This fixes a FIXME in
SourceManager::getPresumedLoc because we now just decompose
the sloc once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 340c2e562a..e0ed77f2dd 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -490,14 +490,10 @@ public: /// for the position indicated. This requires building and caching a table of /// line offsets for the MemoryBuffer, so this is not cheap: use only when /// about to emit a diagnostic. - unsigned getLineNumber(SourceLocation Loc) const; + unsigned getLineNumber(FileID FID, unsigned FilePos) const; - unsigned getInstantiationLineNumber(SourceLocation Loc) const { - return getLineNumber(getInstantiationLoc(Loc)); - } - unsigned getSpellingLineNumber(SourceLocation Loc) const { - return getLineNumber(getSpellingLoc(Loc)); - } + unsigned getInstantiationLineNumber(SourceLocation Loc) const; + unsigned getSpellingLineNumber(SourceLocation Loc) const; // FIXME: This should handle #line. SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const { |