mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-16 11:24:39 +00:00
Make outs() close its file when its stream is destructed, so that
pending output errors are detected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111643 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -540,14 +540,16 @@ bool raw_fd_ostream::is_displayed() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// raw_stdout/err_ostream
|
// outs(), errs(), nulls()
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// outs() - This returns a reference to a raw_ostream for standard output.
|
/// outs() - This returns a reference to a raw_ostream for standard output.
|
||||||
/// Use it like: outs() << "foo" << "bar";
|
/// Use it like: outs() << "foo" << "bar";
|
||||||
raw_ostream &llvm::outs() {
|
raw_ostream &llvm::outs() {
|
||||||
// Set buffer settings to model stdout behavior.
|
// Set buffer settings to model stdout behavior.
|
||||||
static raw_fd_ostream S(STDOUT_FILENO, false);
|
// Delete the file descriptor when the program exists, forcing error
|
||||||
|
// detection. If you don't want this behavior, don't use outs().
|
||||||
|
static raw_fd_ostream S(STDOUT_FILENO, true);
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user