Skip to content

Commit 443f2d6

Browse files
author
Dan Gohman
committed
Delete raw_stdout_ostream and raw_stderr_ostream, which are unused
outside of outs() and errs() themselves, and they don't really need custom classes. llvm-svn: 111642
1 parent e14426a commit 443f2d6

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

llvm/include/llvm/Support/raw_ostream.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -392,24 +392,6 @@ class raw_fd_ostream : public raw_ostream {
392392
}
393393
};
394394

395-
/// raw_stdout_ostream - This is a stream that always prints to stdout.
396-
///
397-
class raw_stdout_ostream : public raw_fd_ostream {
398-
// An out of line virtual method to provide a home for the class vtable.
399-
virtual void handle();
400-
public:
401-
raw_stdout_ostream();
402-
};
403-
404-
/// raw_stderr_ostream - This is a stream that always prints to stderr.
405-
///
406-
class raw_stderr_ostream : public raw_fd_ostream {
407-
// An out of line virtual method to provide a home for the class vtable.
408-
virtual void handle();
409-
public:
410-
raw_stderr_ostream();
411-
};
412-
413395
/// outs() - This returns a reference to a raw_ostream for standard output.
414396
/// Use it like: outs() << "foo" << "bar";
415397
raw_ostream &outs();

llvm/lib/Support/raw_ostream.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -543,27 +543,19 @@ bool raw_fd_ostream::is_displayed() const {
543543
// raw_stdout/err_ostream
544544
//===----------------------------------------------------------------------===//
545545

546-
// Set buffer settings to model stdout and stderr behavior.
547-
// Set standard error to be unbuffered by default.
548-
raw_stdout_ostream::raw_stdout_ostream():raw_fd_ostream(STDOUT_FILENO, false) {}
549-
raw_stderr_ostream::raw_stderr_ostream():raw_fd_ostream(STDERR_FILENO, false,
550-
true) {}
551-
552-
// An out of line virtual method to provide a home for the class vtable.
553-
void raw_stdout_ostream::handle() {}
554-
void raw_stderr_ostream::handle() {}
555-
556546
/// outs() - This returns a reference to a raw_ostream for standard output.
557547
/// Use it like: outs() << "foo" << "bar";
558548
raw_ostream &llvm::outs() {
559-
static raw_stdout_ostream S;
549+
// Set buffer settings to model stdout behavior.
550+
static raw_fd_ostream S(STDOUT_FILENO, false);
560551
return S;
561552
}
562553

563554
/// errs() - This returns a reference to a raw_ostream for standard error.
564555
/// Use it like: errs() << "foo" << "bar";
565556
raw_ostream &llvm::errs() {
566-
static raw_stderr_ostream S;
557+
// Set standard error to be unbuffered by default.
558+
static raw_fd_ostream S(STDERR_FILENO, false, true);
567559
return S;
568560
}
569561

0 commit comments

Comments
 (0)