diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
commit | 721c201bd55ffb73cb2ba8d39e0570fa38c44e15 (patch) | |
tree | eacfc83d988e4b9d11114387ae7dc41243f2a363 /include/llvm/Support/SourceMgr.h | |
parent | 2b2816e083a455f7a656ae88b0fd059d1688bb36 (diff) | |
download | FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.zip FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.tar.gz |
Vendor import of llvm trunk r161861:
http://llvm.org/svn/llvm-project/llvm/trunk@161861
Diffstat (limited to 'include/llvm/Support/SourceMgr.h')
-rw-r--r-- | include/llvm/Support/SourceMgr.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 76967db..8949a3a 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. @@ -169,9 +176,9 @@ public: SMDiagnostic() : SM(0), LineNo(0), ColumnNo(0), Kind(SourceMgr::DK_Error) {} // Diagnostic with no location (e.g. file not found, command line arg error). - SMDiagnostic(const std::string &filename, SourceMgr::DiagKind Kind, + SMDiagnostic(const std::string &filename, SourceMgr::DiagKind Knd, const std::string &Msg) - : SM(0), Filename(filename), LineNo(-1), ColumnNo(-1), Kind(Kind), + : SM(0), Filename(filename), LineNo(-1), ColumnNo(-1), Kind(Knd), Message(Msg) {} // Diagnostic with a location. |