From 97c4cb8947a8616d92622ca4046fcaec7ec17463 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. llvm-svn: 100538 --- llvm/lib/AsmParser/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/AsmParser/Parser.cpp') diff --git a/llvm/lib/AsmParser/Parser.cpp b/llvm/lib/AsmParser/Parser.cpp index 7280cf479f2..e511cbe29c7 100644 --- a/llvm/lib/AsmParser/Parser.cpp +++ b/llvm/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.2.3