[llvm-commits] [llvm] r111638 - /llvm/trunk/include/llvm/Support/FormattedStream.h
Dan Gohman
gohman at apple.com
Fri Aug 20 09:27:38 PDT 2010
Author: djg
Date: Fri Aug 20 11:27:38 2010
New Revision: 111638
URL: http://llvm.org/viewvc/llvm-project?rev=111638&view=rev
Log:
Export error-handling functions in formatted_tool_output_file.
Modified:
llvm/trunk/include/llvm/Support/FormattedStream.h
Modified: llvm/trunk/include/llvm/Support/FormattedStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FormattedStream.h?rev=111638&r1=111637&r2=111638&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FormattedStream.h (original)
+++ llvm/trunk/include/llvm/Support/FormattedStream.h Fri Aug 20 11:27:38 2010
@@ -142,8 +142,13 @@
/// formatted_tool_output_file - This is a subclass of formatted_raw_ostream
/// for use when the underlying stream is a tool_output_file. It exposes
- /// the keep() member function.
+ /// keep() and several other member functions.
class formatted_tool_output_file : public formatted_raw_ostream {
+ private:
+ tool_output_file &get_tool_output_file() const {
+ return *static_cast<tool_output_file *>(TheStream);
+ }
+
public:
formatted_tool_output_file(tool_output_file &Stream, bool Delete = false)
: formatted_raw_ostream(Stream, Delete) {}
@@ -156,7 +161,10 @@
return formatted_raw_ostream::setStream(Stream, Delete);
}
- void keep() { return static_cast<tool_output_file *>(TheStream)->keep(); }
+ void keep() { return get_tool_output_file().keep(); }
+ bool has_error() const { return get_tool_output_file().has_error(); }
+ void clear_error() { return get_tool_output_file().clear_error(); }
+ void close() { return get_tool_output_file().close(); }
};
/// fouts() - This returns a reference to a formatted_raw_ostream for
More information about the llvm-commits
mailing list