Files
allwpilib/upstream_utils/llvm_patches/0017-Fixup-includes.patch
Tyler Veness 44abc8dfa6 [upstream_utils] Remove git version from upstream patches (#4351)
This reduces commit noise when other git versions are used. The version
was removed by passing `--no-signature` to `git format-patch` which is
now documented in the readme.
2022-08-13 18:31:26 -07:00

169 lines
5.2 KiB
Diff

From 8e868fdb545f3facb646418b5e127e360fe88a99 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 17/27] Fixup includes
---
llvm/include/llvm/ADT/StringMap.h | 4 ++++
llvm/include/llvm/ADT/StringMapEntry.h | 4 ++++
llvm/include/llvm/Support/PointerLikeTypeTraits.h | 1 +
llvm/lib/Support/ConvertUTFWrapper.cpp | 1 +
llvm/lib/Support/ErrorHandling.cpp | 7 +++----
llvm/lib/Support/raw_ostream.cpp | 12 ++++++------
llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 ++
llvm/unittests/ADT/StringMapTest.cpp | 1 +
llvm/unittests/Support/ConvertUTFTest.cpp | 2 ++
9 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index ac0d4b363145..f7bf5ad9c063 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -15,6 +15,10 @@
#include "llvm/ADT/StringMapEntry.h"
#include "llvm/Support/AllocatorBase.h"
+#include "llvm/Support/MemAlloc.h"
+#include "llvm/Support/SmallVector.h"
+#include "llvm/Support/iterator.h"
+#include "llvm/Support/iterator_range.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include <initializer_list>
#include <iterator>
diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
index 93e13b5bb16c..cdf11d627200 100644
--- a/llvm/include/llvm/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
@@ -15,6 +15,10 @@
#ifndef LLVM_ADT_STRINGMAPENTRY_H
#define LLVM_ADT_STRINGMAPENTRY_H
+#include "wpi/MemAlloc.h"
+
+#include <cassert>
+#include <cstring>
#include <optional>
#include <string_view>
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
index 1b15f930bd87..acadd5e89a16 100644
--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
@@ -16,6 +16,7 @@
#include "llvm/Support/DataTypes.h"
#include <cassert>
+#include <cstdint>
#include <type_traits>
namespace llvm {
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
index 090ebb0f5af8..87da616b75d4 100644
--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
@@ -8,6 +8,7 @@
#include "llvm/ADT/span.h"
#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/SmallVector.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SwapByteOrder.h"
#include <string>
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index 9c0c6fb868f2..4b6ddd30c6e4 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -28,12 +28,11 @@
#include <mutex>
#include <new>
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
+#ifndef _WIN32
+#include <unistd.h>
#endif
#if defined(_MSC_VER)
-# include <io.h>
-# include <fcntl.h>
+#include <io.h>
#endif
using namespace llvm;
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 27bba0ca2f06..6b9e5f9e44bd 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -15,7 +15,8 @@
#endif
#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/STLExtras.h"
+#include "wpi/SmallString.h"
+#include "wpi/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Compiler.h"
@@ -35,12 +36,11 @@
#include <sys/stat.h>
// <fcntl.h> may provide O_BINARY.
-#if defined(HAVE_FCNTL_H)
# include <fcntl.h>
-#endif
-#if defined(HAVE_UNISTD_H)
-# include <unistd.h>
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/uio.h>
#endif
#if defined(__CYGWIN__)
@@ -62,7 +62,7 @@
#ifdef _WIN32
#include "llvm/Support/ConvertUTF.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 531f81ab5b3f..3db8b6e37d31 100644
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
@@ -15,6 +15,8 @@
#include "llvm/Support/PointerLikeTypeTraits.h"
#include "gtest/gtest.h"
+#include <algorithm>
+
using namespace llvm;
TEST(SmallPtrSetTest, Assignment) {
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
index 081b699adee3..64bb8f85c4b9 100644
--- a/llvm/unittests/ADT/StringMapTest.cpp
+++ b/llvm/unittests/ADT/StringMapTest.cpp
@@ -9,6 +9,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/DataTypes.h"
#include "gtest/gtest.h"
+#include <algorithm>
#include <limits>
#include <tuple>
using namespace llvm;
diff --git a/llvm/unittests/Support/ConvertUTFTest.cpp b/llvm/unittests/Support/ConvertUTFTest.cpp
index 9c798437a12d..2fee8ad5c012 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>