Files
allwpilib/upstream_utils/llvm_patches/0024-Prefer-to-use-static-pointers-in-raw_ostream.patch
Gold856 22b58c1853 [upstream_utils] Upgrade to LLVM 20.1.7 (#8033)
Also removes xxhash, Hashing, and MapVector to reduce the size of the patches and to speed up compile times by a smidge.
2025-06-24 22:36:22 -07:00

38 lines
1.3 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 24/36] 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 3bfebbb41f324d9525290d9105c11fe01502dd87..47ec87cc8cb9576a443f9e0ea35a753e64411495 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -608,9 +608,9 @@ raw_fd_ostream &llvm::outs() {
EC = enablezOSAutoConversion(STDOUT_FILENO);
assert(!EC);
#endif
- 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() {
@@ -619,8 +619,8 @@ raw_fd_ostream &llvm::errs() {
std::error_code EC = enablezOSAutoConversion(STDERR_FILENO);
assert(!EC);
#endif
- 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.