aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-21 19:53:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-21 19:53:10 +0000
commit48534b31d8bc5a68ba152fcdb905bf266def5268 (patch)
treeacbfaacfda9e837cb06f1bf1f25767236bde559b /lib/Support
parentcf891f4dd40eac746e861e7a700f56555b7e8349 (diff)
downloadexternal_llvm-48534b31d8bc5a68ba152fcdb905bf266def5268.zip
external_llvm-48534b31d8bc5a68ba152fcdb905bf266def5268.tar.gz
external_llvm-48534b31d8bc5a68ba152fcdb905bf266def5268.tar.bz2
Clear raw_fd_ostream error string on success and explain behavior in
documentation. Add C++ header marker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/raw_ostream.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 008f856..f3a53a5 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -196,10 +196,13 @@ void format_object_base::home() {
// raw_fd_ostream
//===----------------------------------------------------------------------===//
-/// raw_fd_ostream - Open the specified file for writing. If an error occurs,
-/// information about the error is put into ErrorInfo, and the stream should
-/// be immediately destroyed.
+/// raw_fd_ostream - Open the specified file for writing. If an error
+/// occurs, information about the error is put into ErrorInfo, and the
+/// stream should be immediately destroyed; the string will be empty
+/// if no error occurred.
raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo) {
+ ErrorInfo.clear();
+
// Handle "-" as stdout.
if (Filename[0] == '-' && Filename[1] == 0) {
FD = STDOUT_FILENO;