[Offload] Remove use of raw Linux fd for error reporting (#195073)

Summary:
This is a blocker on builiding Windows, we should be able to share the
common err stream tha LLVM provides
This commit is contained in:
Joseph Huber
2026-04-30 09:25:03 -05:00
committed by GitHub
parent abc009327a
commit d6410f30d7

View File

@@ -28,7 +28,6 @@
#include <functional> #include <functional>
#include <optional> #include <optional>
#include <string> #include <string>
#include <unistd.h>
namespace llvm { namespace llvm {
namespace omp { namespace omp {
@@ -83,7 +82,7 @@ class ErrorReporter {
[[gnu::format(__printf__, 1, 2)]] [[gnu::format(__printf__, 1, 2)]]
#endif #endif
static void print(const char *Format, ArgsTy &&...Args) { static void print(const char *Format, ArgsTy &&...Args) {
raw_fd_ostream OS(STDERR_FILENO, false); auto &OS = llvm::errs();
OS << llvm::format(Format, Args...); OS << llvm::format(Format, Args...);
} }
@@ -94,7 +93,7 @@ class ErrorReporter {
[[gnu::format(__printf__, 2, 3)]] [[gnu::format(__printf__, 2, 3)]]
#endif #endif
static void print(ColorTy Color, const char *Format, ArgsTy &&...Args) { static void print(ColorTy Color, const char *Format, ArgsTy &&...Args) {
raw_fd_ostream OS(STDERR_FILENO, false); auto &OS = llvm::errs();
WithColor(OS, HighlightColor(Color)) << llvm::format(Format, Args...); WithColor(OS, HighlightColor(Color)) << llvm::format(Format, Args...);
} }