llvm.org GIT mirror llvm / 634d661
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 Dan Gohman 10 years ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
141141
142142 /// formatted_tool_output_file - This is a subclass of formatted_raw_ostream
143143 /// for use when the underlying stream is a tool_output_file. It exposes
144 /// the keep() member function.
144 /// keep() and several other member functions.
145145 class formatted_tool_output_file : public formatted_raw_ostream {
146 private:
147 tool_output_file &get_tool_output_file() const {
148 return *static_cast(TheStream);
149 }
150
146151 public:
147152 formatted_tool_output_file(tool_output_file &Stream, bool Delete = false)
148153 : formatted_raw_ostream(Stream, Delete) {}
155160 return formatted_raw_ostream::setStream(Stream, Delete);
156161 }
157162
158 void keep() { return static_cast(TheStream)->keep(); }
163 void keep() { return get_tool_output_file().keep(); }
164 bool has_error() const { return get_tool_output_file().has_error(); }
165 void clear_error() { return get_tool_output_file().clear_error(); }
166 void close() { return get_tool_output_file().close(); }
159167 };
160168
161169 /// fouts() - This returns a reference to a formatted_raw_ostream for