Files
allwpilib/upstream_utils/llvm_patches/0014-Fixup-includes.patch
2026-05-26 21:55:50 -07:00

141 lines
4.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PJ Reiniger <pj.reiniger@gmail.com>
Date: Sun, 8 May 2022 16:38:11 -0400
Subject: [PATCH 14/34] Fixup includes
---
llvm/include/llvm/Support/PointerLikeTypeTraits.h | 1 +
llvm/lib/Support/ConvertUTFWrapper.cpp | 1 +
llvm/lib/Support/ErrorHandling.cpp | 9 ++++-----
llvm/lib/Support/raw_ostream.cpp | 9 ++++++---
llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 ++
llvm/unittests/ADT/SmallVectorTest.cpp | 1 +
llvm/unittests/Support/ConvertUTFTest.cpp | 2 ++
7 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
index a47d68406acf38350a67ce846af4f0c1a5818db1..85152589f7e0f3d31163c5aab109cedf55131681 100644
--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
@@ -17,6 +17,7 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MathExtras.h"
#include <cassert>
+#include <cstdint>
namespace llvm {
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
index 39f151c716dacfef07038551add0f84a09b0cb62..d15c9652b0b79e5ce7a708d30844d0ece3944d2c 100644
--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/SmallVector.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SwapByteOrder.h"
#include <span>
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index fcbc70535bf9869f72d001ec214d7046e975961a..c4366de2aec2f1730954aecfc627dd0e164481ab 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -29,12 +29,11 @@
#include <mutex>
#include <new>
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
+#ifndef _WIN32
+#include <unistd.h>
#endif
#if defined(_WIN32)
-# include <io.h>
-# include <fcntl.h>
+#include <io.h>
#endif
using namespace llvm;
@@ -240,7 +239,7 @@ void LLVMResetFatalErrorHandler() {
#ifdef _WIN32
#define WIN32_NO_STATUS
-#include "llvm/Support/Windows/WindowsSupport.h"
+#include "Windows/WindowsSupport.h"
#undef WIN32_NO_STATUS
#include <ntstatus.h>
#include <winerror.h>
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index dd1ce4a784d096949681e297103c50aa002d636d..459189b0f0a006d465a857f26a78968c4f234a8d 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -15,6 +15,8 @@
#endif
#include "llvm/Support/raw_ostream.h"
+#include "wpi/util/SmallString.hpp"
+#include "wpi/util/SmallVector.hpp"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include "llvm/Support/AutoConvert.h"
@@ -36,8 +38,9 @@
// <fcntl.h> may provide O_BINARY.
# include <fcntl.h>
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/uio.h>
#endif
#if defined(__CYGWIN__)
@@ -60,7 +63,7 @@
#ifdef _WIN32
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Signals.h"
-#include "llvm/Support/Windows/WindowsSupport.h"
+#include "Windows/WindowsSupport.h"
#endif
using namespace llvm;
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
index bbe18dffdcf32d1bd71e756bccca74f1fcee5d0c..33d167cf87e588d46682916888eaf81713854046 100644
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
@@ -16,6 +16,8 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include <algorithm>
+
using namespace llvm;
using testing::UnorderedElementsAre;
diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
index 5589671f7909d1994626c3f0ad043e64ef9768ab..f7a3110f183820212179644fd31009685e172943 100644
--- a/llvm/unittests/ADT/SmallVectorTest.cpp
+++ b/llvm/unittests/ADT/SmallVectorTest.cpp
@@ -14,6 +14,7 @@
#include "llvm/Support/Compiler.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include <array>
#include <list>
#include <span>
#include <stdarg.h>
diff --git a/llvm/unittests/Support/ConvertUTFTest.cpp b/llvm/unittests/Support/ConvertUTFTest.cpp
index 3b07d344f15a555f11ad5f8177a0a65b8a4fa472..77e70a46d3621ecfaed923d87256184addfda721 100644
--- a/llvm/unittests/Support/ConvertUTFTest.cpp
+++ b/llvm/unittests/Support/ConvertUTFTest.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/SmallString.h"
+#include "llvm/Support/SmallVector.h"
#include "gtest/gtest.h"
#include <string>
#include <vector>