diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-06 18:06:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-06 18:06:18 +0000 |
commit | b019491b8d7b171cd0835ba34f3b28b24dfcc3e0 (patch) | |
tree | df8105db1abf53a82e43dbe4fa4c49d12299bc4f /lib | |
parent | 98116f99b6bd766d98a650594d355dedc593d4d4 (diff) | |
download | llvm-b019491b8d7b171cd0835ba34f3b28b24dfcc3e0.tar.gz llvm-b019491b8d7b171cd0835ba34f3b28b24dfcc3e0.tar.bz2 llvm-b019491b8d7b171cd0835ba34f3b28b24dfcc3e0.tar.xz |
enhance SMDiagnostic to also maintain a pointer to the SourceMgr.
Add a simplified constructor for clients that don't have locations
like "file not found" errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/Parser.cpp | 4 | ||||
-rw-r--r-- | lib/Support/SourceMgr.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index 7280cf479f..e511cbe29c 100644 --- a/lib/AsmParser/Parser.cpp +++ b/lib/AsmParser/Parser.cpp @@ -44,9 +44,9 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err, std::string ErrorStr; MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr); if (F == 0) { - Err = SMDiagnostic(SMLoc(), "", -1, -1, + Err = SMDiagnostic(Filename, "Could not open input file '" + Filename + "': " + - ErrorStr, ""); + ErrorStr); return 0; } diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 4e7520c9d3..da5681c5bc 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -168,7 +168,7 @@ SMDiagnostic SourceMgr::GetMessage(SMLoc Loc, const std::string &Msg, } PrintedMsg += Msg; - return SMDiagnostic(Loc, + return SMDiagnostic(*this, Loc, CurMB->getBufferIdentifier(), FindLineNumber(Loc, CurBuf), Loc.getPointer()-LineStart, PrintedMsg, LineStr, ShowLine); |