From b019491b8d7b171cd0835ba34f3b28b24dfcc3e0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 6 Apr 2010 18:06:18 +0000 Subject: 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 --- lib/AsmParser/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/AsmParser') diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index 7280cf4..e511cbe 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; } -- cgit v1.1