blob: f247db0fd9e716e7853301afa1f9150bd0975d89 [file] [log] [blame]
James Kuszmaulcf324122023-01-14 14:07:17 -08001From aa30b80d86cb0774efc094646339b54694ab8398 Mon Sep 17 00:00:00 2001
2From: PJ Reiniger <pj.reiniger@gmail.com>
3Date: Sun, 8 May 2022 16:38:11 -0400
4Subject: [PATCH 17/28] Fixup includes
5
6---
7 llvm/include/llvm/ADT/StringMap.h | 4 ++++
8 llvm/include/llvm/ADT/StringMapEntry.h | 4 ++++
9 llvm/include/llvm/Support/PointerLikeTypeTraits.h | 1 +
10 llvm/lib/Support/ConvertUTFWrapper.cpp | 1 +
11 llvm/lib/Support/ErrorHandling.cpp | 7 +++----
12 llvm/lib/Support/raw_ostream.cpp | 12 ++++++------
13 llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 ++
14 llvm/unittests/ADT/StringMapTest.cpp | 1 +
15 llvm/unittests/Support/ConvertUTFTest.cpp | 2 ++
16 9 files changed, 24 insertions(+), 10 deletions(-)
17
18diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
19index 16f13f048..6ae0e39a1 100644
20--- a/llvm/include/llvm/ADT/StringMap.h
21+++ b/llvm/include/llvm/ADT/StringMap.h
22@@ -17,6 +17,10 @@
23 #include "llvm/ADT/StringMapEntry.h"
24 #include "llvm/ADT/iterator.h"
25 #include "llvm/Support/AllocatorBase.h"
26+#include "llvm/Support/MemAlloc.h"
27+#include "llvm/Support/SmallVector.h"
28+#include "llvm/Support/iterator.h"
29+#include "llvm/Support/iterator_range.h"
30 #include "llvm/Support/PointerLikeTypeTraits.h"
31 #include <initializer_list>
32 #include <iterator>
33diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
34index 39976a02b..cdefc5449 100644
35--- a/llvm/include/llvm/ADT/StringMapEntry.h
36+++ b/llvm/include/llvm/ADT/StringMapEntry.h
37@@ -16,6 +16,10 @@
38 #ifndef LLVM_ADT_STRINGMAPENTRY_H
39 #define LLVM_ADT_STRINGMAPENTRY_H
40
41+#include "wpi/MemAlloc.h"
42+
43+#include <cassert>
44+#include <cstring>
45 #include <optional>
46 #include <string_view>
47
48diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
49index 1b15f930b..acadd5e89 100644
50--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
51+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
52@@ -16,6 +16,7 @@
53
54 #include "llvm/Support/DataTypes.h"
55 #include <cassert>
56+#include <cstdint>
57 #include <type_traits>
58
59 namespace llvm {
60diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
61index 396ab0c65..cff30f16c 100644
62--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
63+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
64@@ -8,6 +8,7 @@
65
66 #include "llvm/ADT/span.h"
67 #include "llvm/Support/ConvertUTF.h"
68+#include "llvm/Support/SmallVector.h"
69 #include "llvm/Support/ErrorHandling.h"
70 #include "llvm/Support/SwapByteOrder.h"
71 #include <string>
72diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
73index f80e28e87..ec1a1633a 100644
74--- a/llvm/lib/Support/ErrorHandling.cpp
75+++ b/llvm/lib/Support/ErrorHandling.cpp
76@@ -28,12 +28,11 @@
77 #include <mutex>
78 #include <new>
79
80-#if defined(HAVE_UNISTD_H)
81-# include <unistd.h>
82+#ifndef _WIN32
83+#include <unistd.h>
84 #endif
85 #if defined(_MSC_VER)
86-# include <io.h>
87-# include <fcntl.h>
88+#include <io.h>
89 #endif
90
91 using namespace llvm;
92diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
93index 95152849c..878a3a5e9 100644
94--- a/llvm/lib/Support/raw_ostream.cpp
95+++ b/llvm/lib/Support/raw_ostream.cpp
96@@ -15,7 +15,8 @@
97 #endif
98
99 #include "llvm/Support/raw_ostream.h"
100-#include "llvm/ADT/STLArrayExtras.h"
101+#include "wpi/SmallString.h"
102+#include "wpi/SmallVector.h"
103 #include "llvm/ADT/StringExtras.h"
104 #include "llvm/Config/config.h"
105 #include "llvm/Support/Compiler.h"
106@@ -33,12 +34,11 @@
107 #include <sys/stat.h>
108
109 // <fcntl.h> may provide O_BINARY.
110-#if defined(HAVE_FCNTL_H)
111 # include <fcntl.h>
112-#endif
113
114-#if defined(HAVE_UNISTD_H)
115-# include <unistd.h>
116+#ifndef _WIN32
117+#include <unistd.h>
118+#include <sys/uio.h>
119 #endif
120
121 #if defined(__CYGWIN__)
122@@ -60,7 +60,7 @@
123
124 #ifdef _WIN32
125 #include "llvm/Support/ConvertUTF.h"
126-#include "llvm/Support/Windows/WindowsSupport.h"
127+#include "Windows/WindowsSupport.h"
128 #endif
129
130 using namespace llvm;
131diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
132index 531f81ab5..3db8b6e37 100644
133--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
134+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
135@@ -15,6 +15,8 @@
136 #include "llvm/Support/PointerLikeTypeTraits.h"
137 #include "gtest/gtest.h"
138
139+#include <algorithm>
140+
141 using namespace llvm;
142
143 TEST(SmallPtrSetTest, Assignment) {
144diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
145index 6d0c0942c..de6daf3da 100644
146--- a/llvm/unittests/ADT/StringMapTest.cpp
147+++ b/llvm/unittests/ADT/StringMapTest.cpp
148@@ -9,6 +9,7 @@
149 #include "llvm/ADT/StringMap.h"
150 #include "llvm/Support/DataTypes.h"
151 #include "gtest/gtest.h"
152+#include <algorithm>
153 #include <limits>
154 #include <tuple>
155 using namespace llvm;
156diff --git a/llvm/unittests/Support/ConvertUTFTest.cpp b/llvm/unittests/Support/ConvertUTFTest.cpp
157index 9c798437a..2fee8ad5c 100644
158--- a/llvm/unittests/Support/ConvertUTFTest.cpp
159+++ b/llvm/unittests/Support/ConvertUTFTest.cpp
160@@ -7,6 +7,8 @@
161 //===----------------------------------------------------------------------===//
162
163 #include "llvm/Support/ConvertUTF.h"
164+#include "llvm/Support/SmallString.h"
165+#include "llvm/Support/SmallVector.h"
166 #include "gtest/gtest.h"
167 #include <string>
168 #include <vector>