summaryrefslogtreecommitdiff
path: root/include/llvm/Support/SourceMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/SourceMgr.h')
-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.