diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-20 16:27:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-20 16:27:38 +0000 |
commit | 634d6619655f96628457d4b7126cd3a398f77631 (patch) | |
tree | 8b10fd4b20d245ac56c319101f35e79362882dcd /include/llvm | |
parent | d6850b0f37e2bfdb189452562c00faa24dc32574 (diff) | |
download | llvm-634d6619655f96628457d4b7126cd3a398f77631.tar.gz llvm-634d6619655f96628457d4b7126cd3a398f77631.tar.bz2 llvm-634d6619655f96628457d4b7126cd3a398f77631.tar.xz |
Export error-handling functions in formatted_tool_output_file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/FormattedStream.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/Support/FormattedStream.h b/include/llvm/Support/FormattedStream.h index 7bc6e478ca..03cde412cd 100644 --- a/include/llvm/Support/FormattedStream.h +++ b/include/llvm/Support/FormattedStream.h @@ -142,8 +142,13 @@ namespace llvm /// 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 @@ namespace llvm 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 |