Files
allwpilib/upstream_utils/llvm_patches/0025-Prefer-to-use-static-pointers-in-raw_ostream.patch
2023-06-08 19:58:21 -07:00

35 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PJ Reiniger <pj.reiniger@gmail.com>
Date: Thu, 19 May 2022 00:58:36 -0400
Subject: [PATCH 25/29] Prefer to use static pointers in raw_ostream
See #1401
---
llvm/lib/Support/raw_ostream.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 632b522358c969682f01dbbb9a6f86cf14093bc3..a703a75edb480b6499ea5ef5945237719b3c565a 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -599,15 +599,15 @@ void raw_fd_ostream::anchor() {}
raw_fd_ostream &llvm::outs() {
// Set buffer settings to model stdout behavior.
std::error_code EC;
- static raw_fd_ostream S("-", EC, sys::fs::OF_None);
+ static raw_fd_ostream* S = new raw_fd_ostream("-", EC, sys::fs::OF_None);
assert(!EC);
- return S;
+ return *S;
}
raw_fd_ostream &llvm::errs() {
// Set standard error to be unbuffered and tied to outs() by default.
- static raw_fd_ostream S(STDERR_FILENO, false, true);
- return S;
+ static raw_fd_ostream* S = new raw_fd_ostream(STDERR_FILENO, false, true);
+ return *S;
}
/// nulls() - This returns a reference to a raw_ostream which discards output.