From e783c63afd577034cb8ff4e3665d0f2d5a945b16 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 3 Oct 2013 16:59:14 +0000 Subject: [PATCH] raw_fd_ostream: Be more verbose about the reason when opening a file fails. llvm-svn: 191911 --- lib/Support/raw_ostream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 92fa8b50a15..cb9648981a3 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -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; }