summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-05-05 22:17:32 +0000
committerChris Lattner <sabre@nondot.org>2012-05-05 22:17:32 +0000
commit77eafd940a2fcbecbd82e1a649b7f081cb4a3d4a (patch)
tree0abdafa095b9e1ee8a73b094951354abe34b306c /include
parentc18e6d937526dfc45a7b57d56ed1120f6a309fc2 (diff)
downloadllvm-77eafd940a2fcbecbd82e1a649b7f081cb4a3d4a.tar.gz
llvm-77eafd940a2fcbecbd82e1a649b7f081cb4a3d4a.tar.bz2
llvm-77eafd940a2fcbecbd82e1a649b7f081cb4a3d4a.tar.xz
reapply my patch, with a fix for an off-by-one error. Turned out to be a lot
of work for a drive-by fix :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/SourceMgr.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h
index 76967dbf78..f108f732b8 100644
--- a/include/llvm/Support/SourceMgr.h
+++ b/include/llvm/Support/SourceMgr.h
@@ -123,7 +123,14 @@ public:
/// FindLineNumber - Find the line number for the specified location in the
/// specified file. This is not a fast method.
- unsigned FindLineNumber(SMLoc Loc, int BufferID = -1) const;
+ unsigned FindLineNumber(SMLoc Loc, int BufferID = -1) const {
+ return getLineAndColumn(Loc, BufferID).first;
+ }
+
+ /// getLineAndColumn - Find the line and column number for the specified
+ /// location in the specified file. This is not a fast method.
+ std::pair<unsigned, unsigned>
+ getLineAndColumn(SMLoc Loc, int BufferID = -1) const;
/// PrintMessage - Emit a message about the specified location with the
/// specified string.