Fix a bug in IRBuilder that's been there for who knows how long. It
[oota-llvm.git] / lib / Support / raw_ostream.cpp
index 92fa8b50a15ef848841a27a5c408d67e40cc57c9..cb9648981a36a851828144d9d8d5cab41192f911 100644 (file)
@@ -447,7 +447,8 @@ raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
   error_code EC = sys::fs::openFileForWrite(Filename, FD, Flags);
 
   if (EC) {
-    ErrorInfo = "Error opening output file '" + std::string(Filename) + "'";
+    ErrorInfo = "Error opening output file '" + std::string(Filename) + "': " +
+                EC.message();
     ShouldClose = false;
     return;
   }