enhance SMDiagnostic to also maintain a pointer to the SourceMgr.
[oota-llvm.git] / lib / AsmParser / Parser.cpp
index 7280cf479f22ee43f975c223f3cde9b3f1f17bdc..e511cbe29c756d6cb63559655f665c28ab74edd6 100644 (file)
@@ -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;
   }