Make ParseIRFile and getLazyIRFileModule incoporate the underlying
authorDan Gohman <gohman@apple.com>
Thu, 27 May 2010 20:47:38 +0000 (20:47 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 27 May 2010 20:47:38 +0000 (20:47 +0000)
error message string into their own error message string, so that
the information isn't lost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104887 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/IRReader.h

index 0dfc302e242aeb48951da32efd0ad1b8f4e9911a..fe47c057558f68fbc4abc22ff9e9a323dc73d621 100644 (file)
@@ -60,7 +60,8 @@ namespace llvm {
     MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrMsg);
     if (F == 0) {
       Err = SMDiagnostic(Filename, 
-                         "Could not open input file '" + Filename + "'");
+                         "Could not open input file "
+                         "'" + Filename + "': " + ErrMsg);
       return 0;
     }
 
@@ -98,7 +99,8 @@ namespace llvm {
     MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrMsg);
     if (F == 0) {
       Err = SMDiagnostic(Filename, 
-                         "Could not open input file '" + Filename + "'");
+                         "Could not open input file "
+                         "'" + Filename + "': " + ErrMsg);
       return 0;
     }