mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
Update LLVM libraries to 14.0.6 (#4350)
The main noticeable change is the SmallString conversion operator to std::string is now explicit instead of implicit.
This commit is contained in:
@@ -1,31 +1,17 @@
|
||||
From e5c61a18376a34b94bf1761f30e017a741e52b0b Mon Sep 17 00:00:00 2001
|
||||
From 3d09b3d7b78ffc037a32725cc4002976b908d965 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 20:50:26 -0400
|
||||
Subject: [PATCH 01/27] Fix spelling / language errors
|
||||
Subject: [PATCH 01/28] Fix spelling/language errors
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/Chrono.h | 2 +-
|
||||
llvm/include/llvm/Support/ErrorHandling.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
|
||||
index f478549a7e4e..004519a883fd 100644
|
||||
--- a/llvm/include/llvm/Support/Chrono.h
|
||||
+++ b/llvm/include/llvm/Support/Chrono.h
|
||||
@@ -22,7 +22,7 @@ class raw_ostream;
|
||||
namespace sys {
|
||||
|
||||
/// A time point on the system clock. This is provided for two reasons:
|
||||
-/// - to insulate us agains subtle differences in behavoir to differences in
|
||||
+/// - to insulate us against subtle differences in behavior to differences in
|
||||
/// system clock precision (which is implementation-defined and differs between
|
||||
/// platforms).
|
||||
/// - to shorten the type name
|
||||
diff --git a/llvm/include/llvm/Support/ErrorHandling.h b/llvm/include/llvm/Support/ErrorHandling.h
|
||||
index 0ec0242d569d..dd85a5892e01 100644
|
||||
index f980510d3..6791df6be 100644
|
||||
--- a/llvm/include/llvm/Support/ErrorHandling.h
|
||||
+++ b/llvm/include/llvm/Support/ErrorHandling.h
|
||||
@@ -45,7 +45,7 @@ class StringRef;
|
||||
@@ -44,7 +44,7 @@ namespace llvm {
|
||||
void install_fatal_error_handler(fatal_error_handler_t handler,
|
||||
void *user_data = nullptr);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +1,21 @@
|
||||
From 48f55e6aa592d66f46f392330317e4efe0502faf Mon Sep 17 00:00:00 2001
|
||||
From 5fccde024bea117d90d215390f09c7d779195ea5 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:12:41 -0400
|
||||
Subject: [PATCH 03/27] Wrap std::min/max calls in parens, for windows warnings
|
||||
Subject: [PATCH 03/28] Wrap std::min/max calls in parens, for Windows warnings
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/DenseMap.h | 4 ++--
|
||||
llvm/include/llvm/ADT/DenseMapInfo.h | 2 +-
|
||||
llvm/include/llvm/ADT/SmallVector.h | 12 ++++++------
|
||||
llvm/include/llvm/Support/ConvertUTF.h | 2 +-
|
||||
llvm/include/llvm/Support/MathExtras.h | 22 +++++++++++-----------
|
||||
llvm/lib/Support/SmallVector.cpp | 2 +-
|
||||
6 files changed, 22 insertions(+), 22 deletions(-)
|
||||
5 files changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
|
||||
index 595eabd0ffb4..588c39faea2f 100644
|
||||
index 7673b66ca..975c3b97e 100644
|
||||
--- a/llvm/include/llvm/ADT/DenseMap.h
|
||||
+++ b/llvm/include/llvm/ADT/DenseMap.h
|
||||
@@ -389,7 +389,7 @@ protected:
|
||||
@@ -390,7 +390,7 @@ protected:
|
||||
return 0;
|
||||
// +1 is required because of the strict equality.
|
||||
// For example if NumEntries is 48, we need to return 401.
|
||||
@@ -25,7 +24,7 @@ index 595eabd0ffb4..588c39faea2f 100644
|
||||
}
|
||||
|
||||
void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) {
|
||||
@@ -825,7 +825,7 @@ public:
|
||||
@@ -826,7 +826,7 @@ public:
|
||||
// Reduce the number of buckets.
|
||||
unsigned NewNumBuckets = 0;
|
||||
if (OldNumEntries)
|
||||
@@ -34,21 +33,8 @@ index 595eabd0ffb4..588c39faea2f 100644
|
||||
if (NewNumBuckets == NumBuckets) {
|
||||
this->BaseT::initEmpty();
|
||||
return;
|
||||
diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h
|
||||
index d276acbfa6a6..0040ac36217e 100644
|
||||
--- a/llvm/include/llvm/ADT/DenseMapInfo.h
|
||||
+++ b/llvm/include/llvm/ADT/DenseMapInfo.h
|
||||
@@ -285,7 +285,7 @@ template <typename... Ts> struct DenseMapInfo<std::tuple<Ts...>> {
|
||||
template <> struct DenseMapInfo<hash_code> {
|
||||
static inline hash_code getEmptyKey() { return hash_code(-1); }
|
||||
static inline hash_code getTombstoneKey() { return hash_code(-2); }
|
||||
- static unsigned getHashValue(hash_code val) { return val; }
|
||||
+ static unsigned getHashValue(hash_code val) { return static_cast<unsigned>(val); }
|
||||
static bool isEqual(hash_code LHS, hash_code RHS) { return LHS == RHS; }
|
||||
};
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index b8a11030fc33..602fcc5b7a98 100644
|
||||
index a4a790323..8686f7bb5 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -49,12 +49,12 @@ protected:
|
||||
@@ -66,8 +52,8 @@ index b8a11030fc33..602fcc5b7a98 100644
|
||||
|
||||
/// This is a helper for \a grow() that's out of line to reduce code
|
||||
/// duplication. This function will report a fatal error if it can't grow at
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
/// which will only be overwritten.
|
||||
@@ -79,7 +79,7 @@ protected:
|
||||
/// This does not construct or destroy any elements in the vector.
|
||||
void set_size(size_t N) {
|
||||
assert(N <= capacity());
|
||||
- Size = N;
|
||||
@@ -75,7 +61,7 @@ index b8a11030fc33..602fcc5b7a98 100644
|
||||
}
|
||||
};
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
|
||||
size_type size_in_bytes() const { return size() * sizeof(T); }
|
||||
size_type max_size() const {
|
||||
@@ -84,7 +70,7 @@ index b8a11030fc33..602fcc5b7a98 100644
|
||||
}
|
||||
|
||||
size_t capacity_in_bytes() const { return capacity() * sizeof(T); }
|
||||
@@ -448,7 +448,7 @@ void SmallVectorTemplateBase<T, TriviallyCopyable>::takeAllocationForGrow(
|
||||
@@ -444,7 +444,7 @@ void SmallVectorTemplateBase<T, TriviallyCopyable>::takeAllocationForGrow(
|
||||
free(this->begin());
|
||||
|
||||
this->BeginX = NewElts;
|
||||
@@ -93,7 +79,7 @@ index b8a11030fc33..602fcc5b7a98 100644
|
||||
}
|
||||
|
||||
/// SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put
|
||||
@@ -674,7 +674,7 @@ public:
|
||||
@@ -693,7 +693,7 @@ public:
|
||||
}
|
||||
|
||||
// Assign over existing elements.
|
||||
@@ -103,7 +89,7 @@ index b8a11030fc33..602fcc5b7a98 100644
|
||||
std::uninitialized_fill_n(this->end(), NumElts - this->size(), Elt);
|
||||
else if (NumElts < this->size())
|
||||
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
|
||||
index 7f1527f51cdf..b085c8a179e8 100644
|
||||
index 7f1527f51..b085c8a17 100644
|
||||
--- a/llvm/include/llvm/Support/ConvertUTF.h
|
||||
+++ b/llvm/include/llvm/Support/ConvertUTF.h
|
||||
@@ -112,7 +112,7 @@ namespace llvm {
|
||||
@@ -116,7 +102,7 @@ index 7f1527f51cdf..b085c8a179e8 100644
|
||||
/* Some fundamental constants */
|
||||
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index 753b1998c40c..db9fbc148ae3 100644
|
||||
index 753b1998c..db9fbc148 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -97,7 +97,7 @@ template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
|
||||
@@ -208,10 +194,10 @@ index 753b1998c40c..db9fbc148ae3 100644
|
||||
|
||||
} // End llvm namespace
|
||||
diff --git a/llvm/lib/Support/SmallVector.cpp b/llvm/lib/Support/SmallVector.cpp
|
||||
index 0005f7840912..26901fe97d20 100644
|
||||
index 8bad715e4..a2b4899e1 100644
|
||||
--- a/llvm/lib/Support/SmallVector.cpp
|
||||
+++ b/llvm/lib/Support/SmallVector.cpp
|
||||
@@ -95,7 +95,7 @@ static size_t getNewCapacity(size_t MinSize, size_t TSize, size_t OldCapacity) {
|
||||
@@ -104,7 +104,7 @@ static size_t getNewCapacity(size_t MinSize, size_t TSize, size_t OldCapacity) {
|
||||
// In theory 2*capacity can overflow if the capacity is 64 bit, but the
|
||||
// original capacity would never be large enough for this to be a problem.
|
||||
size_t NewCapacity = 2 * OldCapacity + 1; // Always grow.
|
||||
@@ -1,17 +1,17 @@
|
||||
From 1c61002f2933aedbcc64ff52de7f69666479e55a Mon Sep 17 00:00:00 2001
|
||||
From 376285281b6173ee3d6650d71148bc173e4a9f7a Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:13:55 -0400
|
||||
Subject: [PATCH 04/27] Change uniqe_function storage size
|
||||
Subject: [PATCH 04/28] Change unique_function storage size
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/FunctionExtras.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
index e67ef7377c88..1a26cb702cae 100644
|
||||
index 5a37417dd..8a9d78f41 100644
|
||||
--- a/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
@@ -72,7 +72,7 @@ using EnableIfCallable =
|
||||
@@ -78,7 +78,7 @@ using EnableIfCallable = std::enable_if_t<llvm::disjunction<
|
||||
|
||||
template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
|
||||
protected:
|
||||
@@ -20,7 +20,7 @@ index e67ef7377c88..1a26cb702cae 100644
|
||||
|
||||
template <typename T, class = void>
|
||||
struct IsSizeLessThanThresholdT : std::false_type {};
|
||||
@@ -151,7 +151,7 @@ protected:
|
||||
@@ -157,7 +157,7 @@ protected:
|
||||
"Should always use all of the out-of-line storage for inline storage!");
|
||||
|
||||
// For in-line storage, we just provide an aligned character buffer. We
|
||||
@@ -1,7 +1,7 @@
|
||||
From 5ca3ff668002f9bf89c134aec9976526c61929da Mon Sep 17 00:00:00 2001
|
||||
From bc86b62f72cbb76a0911996f4b1c6ce476cd1fac Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:17:19 -0400
|
||||
Subject: [PATCH 05/27] Threading updates
|
||||
Subject: [PATCH 05/28] Threading updates
|
||||
|
||||
- Remove guards for threads and exception
|
||||
- Prefer scope gaurd over lock gaurd
|
||||
@@ -12,10 +12,10 @@ Subject: [PATCH 05/27] Threading updates
|
||||
3 files changed, 11 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
|
||||
index f4d6612fe074..989d25bb03b9 100644
|
||||
index f5d726ec8..ede1cb172 100644
|
||||
--- a/llvm/include/llvm/Support/Compiler.h
|
||||
+++ b/llvm/include/llvm/Support/Compiler.h
|
||||
@@ -525,7 +525,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -540,7 +540,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
/// initialize to some constant value. In almost all circumstances this is most
|
||||
/// appropriate for use with a pointer, integer, or small aggregation of
|
||||
/// pointers and integers.
|
||||
@@ -23,7 +23,7 @@ index f4d6612fe074..989d25bb03b9 100644
|
||||
#if __has_feature(cxx_thread_local) || defined(_MSC_VER)
|
||||
#define LLVM_THREAD_LOCAL thread_local
|
||||
#else
|
||||
@@ -533,11 +532,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -548,11 +547,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
// we only need the restricted functionality that provides.
|
||||
#define LLVM_THREAD_LOCAL __thread
|
||||
#endif
|
||||
@@ -36,7 +36,7 @@ index f4d6612fe074..989d25bb03b9 100644
|
||||
/// \macro LLVM_ENABLE_EXCEPTIONS
|
||||
/// Whether LLVM is built with exception support.
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 19d1fd77af12..2403db9c80f1 100644
|
||||
index 8ae8fb8b4..89440b5ab 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -44,7 +44,6 @@ static void *ErrorHandlerUserData = nullptr;
|
||||
@@ -151,7 +151,7 @@ index 19d1fd77af12..2403db9c80f1 100644
|
||||
void llvm::llvm_unreachable_internal(const char *msg, const char *file,
|
||||
unsigned line) {
|
||||
diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
|
||||
index a6ae67066ea0..fc798b7ec1b7 100644
|
||||
index a6ae67066..fc798b7ec 100644
|
||||
--- a/llvm/lib/Support/ManagedStatic.cpp
|
||||
+++ b/llvm/lib/Support/ManagedStatic.cpp
|
||||
@@ -12,23 +12,23 @@
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
From 20727a44aa8138cbda12065a6087390b4632b958 Mon Sep 17 00:00:00 2001
|
||||
From 008e921f77933f475174d74a6b70309c6fbe0771 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:28:13 -0400
|
||||
Subject: [PATCH 06/27] #ifdef guard safety
|
||||
Subject: [PATCH 06/28] \#ifdef guard safety
|
||||
|
||||
Prevents redefinition if someone is pulling in real LLVM, since the macros are in global namespace
|
||||
---
|
||||
llvm/include/llvm/Support/Compiler.h | 54 ++++++++++++++++++++++++++++
|
||||
1 file changed, 54 insertions(+)
|
||||
llvm/include/llvm/Support/Compiler.h | 50 ++++++++++++++++++++++++++++
|
||||
1 file changed, 50 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
|
||||
index 989d25bb03b9..14f95ae8cc52 100644
|
||||
index ede1cb172..8b8260b50 100644
|
||||
--- a/llvm/include/llvm/Support/Compiler.h
|
||||
+++ b/llvm/include/llvm/Support/Compiler.h
|
||||
@@ -80,6 +80,7 @@
|
||||
/// * 1916: VS2017, version 15.9
|
||||
/// * 1920: VS2019, version 16.0
|
||||
/// * 1921: VS2019, version 16.1
|
||||
@@ -86,6 +86,7 @@
|
||||
/// * 1928: VS2019, version 16.8 + 16.9
|
||||
/// * 1929: VS2019, version 16.10 + 16.11
|
||||
/// * 1930: VS2022, version 17.0
|
||||
+#ifndef LLVM_MSC_PREREQ
|
||||
#ifdef _MSC_VER
|
||||
#define LLVM_MSC_PREREQ(version) (_MSC_VER >= (version))
|
||||
|
||||
@@ -91,28 +92,33 @@
|
||||
@@ -99,6 +100,7 @@
|
||||
#else
|
||||
#define LLVM_MSC_PREREQ(version) 0
|
||||
#endif
|
||||
@@ -28,19 +28,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// Does the compiler support ref-qualifiers for *this?
|
||||
///
|
||||
/// Sadly, this is separate from just rvalue reference support because GCC
|
||||
/// and MSVC implemented this later than everything else. This appears to be
|
||||
/// corrected in MSVC 2019 but not MSVC 2017.
|
||||
+#ifndef LLVM_HAS_RVALUE_REFERENCE_THIS
|
||||
#if __has_feature(cxx_rvalue_references) || LLVM_GNUC_PREREQ(4, 8, 1) || \
|
||||
LLVM_MSC_PREREQ(1920)
|
||||
#define LLVM_HAS_RVALUE_REFERENCE_THIS 1
|
||||
#else
|
||||
#define LLVM_HAS_RVALUE_REFERENCE_THIS 0
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/// Expands to '&' if ref-qualifiers for *this are supported.
|
||||
@@ -112,11 +114,13 @@
|
||||
///
|
||||
/// This can be used to provide lvalue/rvalue overrides of member functions.
|
||||
/// The rvalue override should be guarded by LLVM_HAS_RVALUE_REFERENCE_THIS
|
||||
@@ -54,7 +42,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked
|
||||
/// into a shared library, then the class should be private to the library and
|
||||
@@ -132,21 +138,26 @@
|
||||
@@ -140,21 +144,26 @@
|
||||
#define LLVM_EXTERNAL_VISIBILITY
|
||||
#endif
|
||||
|
||||
@@ -67,7 +55,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
+#endif
|
||||
|
||||
+#ifndef LLVM_ATTRIBUTE_USED
|
||||
#if __has_attribute(used) || LLVM_GNUC_PREREQ(3, 1, 0)
|
||||
#if __has_attribute(used)
|
||||
#define LLVM_ATTRIBUTE_USED __attribute__((__used__))
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_USED
|
||||
@@ -81,7 +69,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#if defined(__cplusplus) && __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
|
||||
#define LLVM_NODISCARD [[nodiscard]]
|
||||
#elif LLVM_HAS_CPP_ATTRIBUTE(clang::warn_unused_result)
|
||||
@@ -160,6 +171,7 @@
|
||||
@@ -168,6 +177,7 @@
|
||||
#else
|
||||
#define LLVM_NODISCARD
|
||||
#endif
|
||||
@@ -89,12 +77,12 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
// Indicate that a non-static, non-const C++ member function reinitializes
|
||||
// the entire object to a known state, independent of the previous state of
|
||||
@@ -182,11 +194,13 @@
|
||||
@@ -190,11 +200,13 @@
|
||||
// more portable solution:
|
||||
// (void)unused_var_name;
|
||||
// Prefer cast-to-void wherever it is sufficient.
|
||||
+#ifndef LLVM_ATTRIBUTE_UNUSED
|
||||
#if __has_attribute(unused) || LLVM_GNUC_PREREQ(3, 1, 0)
|
||||
#if __has_attribute(unused)
|
||||
#define LLVM_ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_UNUSED
|
||||
@@ -102,8 +90,8 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
+#endif
|
||||
|
||||
// FIXME: Provide this for PE/COFF targets.
|
||||
#if (__has_attribute(weak) || LLVM_GNUC_PREREQ(4, 0, 0)) && \
|
||||
@@ -196,6 +210,7 @@
|
||||
#if __has_attribute(weak) && !defined(__MINGW32__) && !defined(__CYGWIN__) && \
|
||||
@@ -204,6 +216,7 @@
|
||||
#define LLVM_ATTRIBUTE_WEAK
|
||||
#endif
|
||||
|
||||
@@ -111,7 +99,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
// Prior to clang 3.2, clang did not accept any spelling of
|
||||
// __has_attribute(const), so assume it is supported.
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
@@ -204,14 +219,18 @@
|
||||
@@ -212,13 +225,16 @@
|
||||
#else
|
||||
#define LLVM_READNONE
|
||||
#endif
|
||||
@@ -126,11 +114,17 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if __has_attribute(minsize)
|
||||
#define LLVM_ATTRIBUTE_MINSIZE __attribute__((minsize))
|
||||
@@ -226,6 +242,7 @@
|
||||
#define LLVM_ATTRIBUTE_MINSIZE
|
||||
#endif
|
||||
|
||||
+#ifndef LLVM_LIKELY
|
||||
#if __has_builtin(__builtin_expect) || LLVM_GNUC_PREREQ(4, 0, 0)
|
||||
#if __has_builtin(__builtin_expect) || defined(__GNUC__)
|
||||
#define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)
|
||||
#define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
|
||||
@@ -219,9 +238,11 @@
|
||||
@@ -233,9 +250,11 @@
|
||||
#define LLVM_LIKELY(EXPR) (EXPR)
|
||||
#define LLVM_UNLIKELY(EXPR) (EXPR)
|
||||
#endif
|
||||
@@ -139,44 +133,38 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
/// LLVM_ATTRIBUTE_NOINLINE - On compilers where we have a directive to do so,
|
||||
/// mark a method "not for inlining".
|
||||
+#ifndef LLVM_ATTRIBUTE_NOINLINE
|
||||
#if __has_attribute(noinline) || LLVM_GNUC_PREREQ(3, 4, 0)
|
||||
#if __has_attribute(noinline)
|
||||
#define LLVM_ATTRIBUTE_NOINLINE __attribute__((noinline))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -229,11 +250,13 @@
|
||||
@@ -243,9 +262,11 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_NOINLINE
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/// LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do
|
||||
/// so, mark a method "always inline" because it is performance sensitive. GCC
|
||||
/// 3.4 supported this but is buggy in various cases and produces unimplemented
|
||||
/// errors, just use it in GCC 4.0 and later.
|
||||
/// so, mark a method "always inline" because it is performance sensitive.
|
||||
+#ifndef LLVM_ATTRIBUTE_ALWAYS_INLINE
|
||||
#if __has_attribute(always_inline) || LLVM_GNUC_PREREQ(4, 0, 0)
|
||||
#if __has_attribute(always_inline)
|
||||
#define LLVM_ATTRIBUTE_ALWAYS_INLINE inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -241,7 +264,9 @@
|
||||
@@ -253,6 +274,7 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_ALWAYS_INLINE inline
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
+#ifndef LLVM_ATTRIBUTE_NORETURN
|
||||
#ifdef __GNUC__
|
||||
#define LLVM_ATTRIBUTE_NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -249,7 +274,9 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_NORETURN
|
||||
/// LLVM_ATTRIBUTE_NO_DEBUG - On compilers where we have a directive to do
|
||||
/// so, mark a method "no debug" because debug info makes the debugger
|
||||
@@ -263,6 +285,7 @@
|
||||
#define LLVM_ATTRIBUTE_NODEBUG
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
+#ifndef LLVM_ATTRIBUTE_RETURNS_NONNULL
|
||||
#if __has_attribute(returns_nonnull) || LLVM_GNUC_PREREQ(4, 9, 0)
|
||||
#if __has_attribute(returns_nonnull)
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -257,9 +284,11 @@
|
||||
@@ -270,9 +293,11 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
|
||||
#endif
|
||||
@@ -188,7 +176,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#ifdef __GNUC__
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS __attribute__((__malloc__))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -267,8 +296,10 @@
|
||||
@@ -280,8 +305,10 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS
|
||||
#endif
|
||||
@@ -199,7 +187,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#if defined(__cplusplus) && __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(fallthrough)
|
||||
#define LLVM_FALLTHROUGH [[fallthrough]]
|
||||
#elif LLVM_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
|
||||
@@ -280,6 +311,7 @@
|
||||
@@ -293,6 +320,7 @@
|
||||
#else
|
||||
#define LLVM_FALLTHROUGH
|
||||
#endif
|
||||
@@ -207,7 +195,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// LLVM_REQUIRE_CONSTANT_INITIALIZATION - Apply this to globals to ensure that
|
||||
/// they are constant initialized.
|
||||
@@ -308,28 +340,35 @@
|
||||
@@ -321,20 +349,25 @@
|
||||
|
||||
/// LLVM_EXTENSION - Support compilers where we have a keyword to suppress
|
||||
/// pedantic diagnostics.
|
||||
@@ -230,20 +218,22 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
/// to an expression which states that it is undefined behavior for the
|
||||
/// compiler to reach this point. Otherwise is not defined.
|
||||
+#ifndef LLVM_BUILTIN_UNREACHABLE
|
||||
#if __has_builtin(__builtin_unreachable) || LLVM_GNUC_PREREQ(4, 5, 0)
|
||||
#if __has_builtin(__builtin_unreachable) || defined(__GNUC__)
|
||||
# define LLVM_BUILTIN_UNREACHABLE __builtin_unreachable()
|
||||
#elif defined(_MSC_VER)
|
||||
# define LLVM_BUILTIN_UNREACHABLE __assume(false)
|
||||
@@ -342,9 +375,11 @@
|
||||
#else
|
||||
# define LLVM_BUILTIN_UNREACHABLE
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/// LLVM_BUILTIN_TRAP - On compilers which support it, expands to an expression
|
||||
/// which causes the program to exit abnormally.
|
||||
+#ifndef LLVM_BUILTIN_TRAP
|
||||
#if __has_builtin(__builtin_trap) || LLVM_GNUC_PREREQ(4, 3, 0)
|
||||
#if __has_builtin(__builtin_trap) || defined(__GNUC__)
|
||||
# define LLVM_BUILTIN_TRAP __builtin_trap()
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -341,10 +380,12 @@
|
||||
@@ -356,10 +391,12 @@
|
||||
#else
|
||||
# define LLVM_BUILTIN_TRAP *(volatile int*)0x11 = 0
|
||||
#endif
|
||||
@@ -256,7 +246,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#if __has_builtin(__builtin_debugtrap)
|
||||
# define LLVM_BUILTIN_DEBUGTRAP __builtin_debugtrap()
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -358,9 +399,11 @@
|
||||
@@ -373,9 +410,11 @@
|
||||
// program to abort if encountered.
|
||||
# define LLVM_BUILTIN_DEBUGTRAP
|
||||
#endif
|
||||
@@ -265,10 +255,10 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
/// \macro LLVM_ASSUME_ALIGNED
|
||||
/// Returns a pointer with an assumed alignment.
|
||||
+#ifndef LLVM_ASSUME_ALIGNED
|
||||
#if __has_builtin(__builtin_assume_aligned) || LLVM_GNUC_PREREQ(4, 7, 0)
|
||||
#if __has_builtin(__builtin_assume_aligned) || defined(__GNUC__)
|
||||
# define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)
|
||||
#elif defined(LLVM_BUILTIN_UNREACHABLE)
|
||||
@@ -369,6 +412,7 @@
|
||||
@@ -384,6 +423,7 @@
|
||||
#else
|
||||
# define LLVM_ASSUME_ALIGNED(p, a) (p)
|
||||
#endif
|
||||
@@ -276,7 +266,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// \macro LLVM_PACKED
|
||||
/// Used to specify a packed structure.
|
||||
@@ -388,6 +432,7 @@
|
||||
@@ -403,6 +443,7 @@
|
||||
/// long long l;
|
||||
/// };
|
||||
/// LLVM_PACKED_END
|
||||
@@ -284,7 +274,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#ifdef _MSC_VER
|
||||
# define LLVM_PACKED(d) __pragma(pack(push, 1)) d __pragma(pack(pop))
|
||||
# define LLVM_PACKED_START __pragma(pack(push, 1))
|
||||
@@ -397,11 +442,13 @@
|
||||
@@ -412,11 +453,13 @@
|
||||
# define LLVM_PACKED_START _Pragma("pack(push, 1)")
|
||||
# define LLVM_PACKED_END _Pragma("pack(pop)")
|
||||
#endif
|
||||
@@ -298,7 +288,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#ifdef __SIZEOF_POINTER__
|
||||
# define LLVM_PTR_SIZE __SIZEOF_POINTER__
|
||||
#elif defined(_WIN64)
|
||||
@@ -413,6 +460,7 @@
|
||||
@@ -428,6 +471,7 @@
|
||||
#else
|
||||
# define LLVM_PTR_SIZE sizeof(void *)
|
||||
#endif
|
||||
@@ -306,7 +296,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// \macro LLVM_MEMORY_SANITIZER_BUILD
|
||||
/// Whether LLVM itself is built with MemorySanitizer instrumentation.
|
||||
@@ -483,11 +531,13 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -498,11 +542,13 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
|
||||
/// \macro LLVM_NO_SANITIZE
|
||||
/// Disable a particular sanitizer for a function.
|
||||
@@ -320,7 +310,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
|
||||
/// Mark debug helper function definitions like dump() that should not be
|
||||
/// stripped from debug builds.
|
||||
@@ -495,17 +545,20 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -510,17 +556,20 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
/// `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` so they do always
|
||||
/// get stripped in release builds.
|
||||
// FIXME: Move this to a private config.h as it's not usable in public headers.
|
||||
@@ -341,7 +331,7 @@ index 989d25bb03b9..14f95ae8cc52 100644
|
||||
#if defined(_MSC_VER)
|
||||
#define LLVM_PRETTY_FUNCTION __FUNCSIG__
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
@@ -513,6 +566,7 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -528,6 +577,7 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
#else
|
||||
#define LLVM_PRETTY_FUNCTION __func__
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6098845aed7416fde8a9c1f276571c8a1bc27799 Mon Sep 17 00:00:00 2001
|
||||
From c26562caae6a685716a8785ad8689833c9996549 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:37:34 -0400
|
||||
Subject: [PATCH 07/27] Explicitly use std::
|
||||
Subject: [PATCH 07/28] Explicitly use std::
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallSet.h | 2 +-
|
||||
@@ -12,10 +12,10 @@ Subject: [PATCH 07/27] Explicitly use std::
|
||||
5 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
|
||||
index e4c209c5f2a9..f2b402ccf9a0 100644
|
||||
index bfe93e997..403e108fd 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallSet.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallSet.h
|
||||
@@ -269,7 +269,7 @@ bool operator==(const SmallSet<T, LN, C> &LHS, const SmallSet<T, RN, C> &RHS) {
|
||||
@@ -270,7 +270,7 @@ bool operator==(const SmallSet<T, LN, C> &LHS, const SmallSet<T, RN, C> &RHS) {
|
||||
return false;
|
||||
|
||||
// All elements in LHS must also be in RHS
|
||||
@@ -25,7 +25,7 @@ index e4c209c5f2a9..f2b402ccf9a0 100644
|
||||
|
||||
/// Inequality comparison for SmallSet.
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index db9fbc148ae3..da843ef79ff9 100644
|
||||
index db9fbc148..da843ef79 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -586,7 +586,7 @@ inline double Log2(double Value) {
|
||||
@@ -38,7 +38,7 @@ index db9fbc148ae3..da843ef79ff9 100644
|
||||
}
|
||||
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 2403db9c80f1..9c0c6fb868f2 100644
|
||||
index 89440b5ab..f80e28e87 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -210,7 +210,7 @@ void LLVMResetFatalErrorHandler() {
|
||||
@@ -51,7 +51,7 @@ index 2403db9c80f1..9c0c6fb868f2 100644
|
||||
std::error_code llvm::mapWindowsError(unsigned EV) {
|
||||
switch (EV) {
|
||||
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
index 6f3c94eed273..531f81ab5b3f 100644
|
||||
index 6f3c94eed..531f81ab5 100644
|
||||
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
@@ -298,7 +298,7 @@ TEST(SmallPtrSetTest, dereferenceAndIterate) {
|
||||
@@ -64,10 +64,10 @@ index 6f3c94eed273..531f81ab5b3f 100644
|
||||
EXPECT_EQ(F - Found + 1, *F);
|
||||
}
|
||||
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
index 18beb3878067..081b699adee3 100644
|
||||
index 86907ab61..6d0c0942c 100644
|
||||
--- a/llvm/unittests/ADT/StringMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
@@ -308,7 +308,7 @@ TEST_F(StringMapTest, IterMapKeys) {
|
||||
@@ -329,7 +329,7 @@ TEST_F(StringMapTest, IterMapKeysSmallVector) {
|
||||
Map["D"] = 3;
|
||||
|
||||
auto Keys = to_vector<4>(Map.keys());
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
From c7d5902712292ad85b8580437c1f09a16d79def9 Mon Sep 17 00:00:00 2001
|
||||
From f35fcb2c40caceed14437e65131e9fe1cf94deac Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:53:50 -0400
|
||||
Subject: [PATCH 08/27] Remove format_provider
|
||||
Subject: [PATCH 08/28] Remove format_provider
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/Chrono.h | 109 ------------------------
|
||||
llvm/include/llvm/Support/raw_ostream.h | 5 --
|
||||
llvm/include/llvm/Support/raw_ostream.h | 6 --
|
||||
llvm/unittests/Support/Chrono.cpp | 61 -------------
|
||||
3 files changed, 175 deletions(-)
|
||||
3 files changed, 176 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
|
||||
index 2c2869de49b6..06829d1fbe14 100644
|
||||
index a7dea19d9..9f9a2b5ca 100644
|
||||
--- a/llvm/include/llvm/Support/Chrono.h
|
||||
+++ b/llvm/include/llvm/Support/Chrono.h
|
||||
@@ -10,7 +10,6 @@
|
||||
@@ -21,7 +21,7 @@ index 2c2869de49b6..06829d1fbe14 100644
|
||||
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
@@ -58,114 +57,6 @@ toTimePoint(std::time_t T, uint32_t nsec) {
|
||||
@@ -59,114 +58,6 @@ toTimePoint(std::time_t T, uint32_t nsec) {
|
||||
|
||||
raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
|
||||
|
||||
@@ -137,13 +137,14 @@ index 2c2869de49b6..06829d1fbe14 100644
|
||||
|
||||
#endif // LLVM_SUPPORT_CHRONO_H
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 4f6ea873304f..94d0ed66eced 100644
|
||||
index 9a1dd7a60..a25ca5b7b 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -29,11 +29,6 @@
|
||||
@@ -28,12 +28,6 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
-class Duration;
|
||||
-class formatv_object_base;
|
||||
-class format_object_base;
|
||||
-class FormattedString;
|
||||
@@ -153,7 +154,7 @@ index 4f6ea873304f..94d0ed66eced 100644
|
||||
|
||||
namespace sys {
|
||||
diff --git a/llvm/unittests/Support/Chrono.cpp b/llvm/unittests/Support/Chrono.cpp
|
||||
index 9a08a5c1bfdf..3c049de18c0a 100644
|
||||
index 9a08a5c1b..3c049de18 100644
|
||||
--- a/llvm/unittests/Support/Chrono.cpp
|
||||
+++ b/llvm/unittests/Support/Chrono.cpp
|
||||
@@ -30,37 +30,6 @@ TEST(Chrono, TimeTConversion) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
From a55cc2394a9fca533d8d07e3b61e47fedb99cd1b Mon Sep 17 00:00:00 2001
|
||||
From 2c53d8ac36f378fda347f36ef2bc7fbc2038cb93 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:34:07 -0400
|
||||
Subject: [PATCH 09/27] Add compiler warning pragrams
|
||||
Subject: [PATCH 09/28] Add compiler warning pragmas
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/FunctionExtras.h | 10 ++++++++++
|
||||
llvm/include/llvm/ADT/FunctionExtras.h | 11 +++++++++++
|
||||
llvm/include/llvm/ADT/Hashing.h | 9 +++++++++
|
||||
llvm/include/llvm/ADT/SmallVector.h | 8 ++++++++
|
||||
llvm/include/llvm/Support/MathExtras.h | 9 +++++++++
|
||||
@@ -14,26 +14,27 @@ Subject: [PATCH 09/27] Add compiler warning pragrams
|
||||
llvm/unittests/ADT/MapVectorTest.cpp | 7 +++++++
|
||||
llvm/unittests/ADT/SmallVectorTest.cpp | 4 ++++
|
||||
llvm/unittests/Support/AlignOfTest.cpp | 7 +++----
|
||||
10 files changed, 71 insertions(+), 4 deletions(-)
|
||||
10 files changed, 72 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
index 1a26cb702cae..3b834236b8fa 100644
|
||||
index 8a9d78f41..3efa73587 100644
|
||||
--- a/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
@@ -54,6 +54,12 @@ namespace llvm {
|
||||
@@ -55,6 +55,13 @@ namespace llvm {
|
||||
/// It can hold functions with a non-const operator(), like mutable lambdas.
|
||||
template <typename FunctionT> class unique_function;
|
||||
|
||||
+// GCC warns on OutOfLineStorage
|
||||
+#if defined(__GNUC__) && !defined(__clang__)
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
+#endif
|
||||
+
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
@@ -405,6 +411,10 @@ public:
|
||||
@@ -411,6 +418,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,7 +46,7 @@ index 1a26cb702cae..3b834236b8fa 100644
|
||||
|
||||
#endif // LLVM_ADT_FUNCTIONEXTRAS_H
|
||||
diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
|
||||
index e296c1c53ebd..8f90b4214b92 100644
|
||||
index 74a87a3d8..47ff1b2bc 100644
|
||||
--- a/llvm/include/llvm/ADT/Hashing.h
|
||||
+++ b/llvm/include/llvm/ADT/Hashing.h
|
||||
@@ -55,6 +55,11 @@
|
||||
@@ -58,9 +59,9 @@ index e296c1c53ebd..8f90b4214b92 100644
|
||||
+#endif
|
||||
+
|
||||
namespace llvm {
|
||||
template <typename T, typename Enable> struct DenseMapInfo;
|
||||
|
||||
/// An opaque object representing a hash code.
|
||||
@@ -679,4 +684,8 @@ hash_code hash_value(const std::basic_string<T> &arg) {
|
||||
@@ -687,4 +692,8 @@ template <> struct DenseMapInfo<hash_code, void> {
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
@@ -70,10 +71,10 @@ index e296c1c53ebd..8f90b4214b92 100644
|
||||
+
|
||||
#endif
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index 602fcc5b7a98..690d512a43c8 100644
|
||||
index 8686f7bb5..1e311ea56 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -13,6 +13,14 @@
|
||||
@@ -14,6 +14,14 @@
|
||||
#ifndef LLVM_ADT_SMALLVECTOR_H
|
||||
#define LLVM_ADT_SMALLVECTOR_H
|
||||
|
||||
@@ -85,11 +86,11 @@ index 602fcc5b7a98..690d512a43c8 100644
|
||||
+#pragma GCC diagnostic warning "-Wclass-memaccess"
|
||||
+#endif
|
||||
+
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/type_traits.h"
|
||||
#include <algorithm>
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index da843ef79ff9..fac12dd0e4c6 100644
|
||||
index da843ef79..fac12dd0e 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -435,6 +435,11 @@ inline uint64_t maxUIntN(uint64_t N) {
|
||||
@@ -116,7 +117,7 @@ index da843ef79ff9..fac12dd0e4c6 100644
|
||||
inline int64_t maxIntN(int64_t N) {
|
||||
assert(N > 0 && N <= 64 && "integer width out of range");
|
||||
diff --git a/llvm/include/llvm/Support/MemAlloc.h b/llvm/include/llvm/Support/MemAlloc.h
|
||||
index d6012bd5a698..01007deb89bb 100644
|
||||
index d6012bd5a..01007deb8 100644
|
||||
--- a/llvm/include/llvm/Support/MemAlloc.h
|
||||
+++ b/llvm/include/llvm/Support/MemAlloc.h
|
||||
@@ -22,6 +22,14 @@
|
||||
@@ -145,7 +146,7 @@ index d6012bd5a698..01007deb89bb 100644
|
||||
+
|
||||
#endif
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 306cc981ed8f..bff7b6c9a77b 100644
|
||||
index e4c318eb8..ee01a9522 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -10,6 +10,10 @@
|
||||
@@ -157,10 +158,10 @@ index 306cc981ed8f..bff7b6c9a77b 100644
|
||||
+#endif
|
||||
+
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/STLArrayExtras.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
index a122f1fe3bdf..123012a3118d 100644
|
||||
index e505b1907..9fe83a45d 100644
|
||||
--- a/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
@@ -6,6 +6,10 @@
|
||||
@@ -175,7 +176,7 @@ index a122f1fe3bdf..123012a3118d 100644
|
||||
#include "gtest/gtest.h"
|
||||
#include <map>
|
||||
diff --git a/llvm/unittests/ADT/MapVectorTest.cpp b/llvm/unittests/ADT/MapVectorTest.cpp
|
||||
index 552f9956bdc2..20ebcd753bcc 100644
|
||||
index 552f9956b..20ebcd753 100644
|
||||
--- a/llvm/unittests/ADT/MapVectorTest.cpp
|
||||
+++ b/llvm/unittests/ADT/MapVectorTest.cpp
|
||||
@@ -6,6 +6,13 @@
|
||||
@@ -193,7 +194,7 @@ index 552f9956bdc2..20ebcd753bcc 100644
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "gtest/gtest.h"
|
||||
diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
|
||||
index 1914f38fac6c..387229c32d5a 100644
|
||||
index fe827546a..0e68bad6c 100644
|
||||
--- a/llvm/unittests/ADT/SmallVectorTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallVectorTest.cpp
|
||||
@@ -17,6 +17,10 @@
|
||||
@@ -208,7 +209,7 @@ index 1914f38fac6c..387229c32d5a 100644
|
||||
|
||||
namespace {
|
||||
diff --git a/llvm/unittests/Support/AlignOfTest.cpp b/llvm/unittests/Support/AlignOfTest.cpp
|
||||
index f84895c18602..6a50205b143b 100644
|
||||
index f84895c18..6a50205b1 100644
|
||||
--- a/llvm/unittests/Support/AlignOfTest.cpp
|
||||
+++ b/llvm/unittests/Support/AlignOfTest.cpp
|
||||
@@ -31,10 +31,9 @@ namespace {
|
||||
@@ -1,21 +1,21 @@
|
||||
From 1354697da0c8661ef6030eb6355a680bbed7b752 Mon Sep 17 00:00:00 2001
|
||||
From df2dc9fdb3d57e01423104a71a6a1d1d6382644a Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:43:50 -0400
|
||||
Subject: [PATCH 10/27] Remove unused functions
|
||||
Subject: [PATCH 10/28] Remove unused functions
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallString.h | 80 ------
|
||||
llvm/include/llvm/Support/Errno.h | 9 -
|
||||
llvm/include/llvm/Support/VersionTuple.h | 33 ---
|
||||
llvm/include/llvm/Support/VersionTuple.h | 40 ---
|
||||
llvm/include/llvm/Support/raw_ostream.h | 115 +-------
|
||||
llvm/lib/Support/raw_ostream.cpp | 327 -----------------------
|
||||
5 files changed, 8 insertions(+), 556 deletions(-)
|
||||
llvm/lib/Support/raw_ostream.cpp | 328 -----------------------
|
||||
5 files changed, 8 insertions(+), 564 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
|
||||
index 8112741dd01d..85987811f3c4 100644
|
||||
index 50cbdade4..bfa965fd6 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallString.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallString.h
|
||||
@@ -86,48 +86,12 @@ public:
|
||||
@@ -88,48 +88,12 @@ public:
|
||||
/// @name String Comparison
|
||||
/// @{
|
||||
|
||||
@@ -64,7 +64,7 @@ index 8112741dd01d..85987811f3c4 100644
|
||||
/// @}
|
||||
/// @name String Searching
|
||||
/// @{
|
||||
@@ -208,50 +172,6 @@ public:
|
||||
@@ -210,50 +174,6 @@ public:
|
||||
}
|
||||
|
||||
/// @}
|
||||
@@ -116,7 +116,7 @@ index 8112741dd01d..85987811f3c4 100644
|
||||
// Extra methods.
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Errno.h b/llvm/include/llvm/Support/Errno.h
|
||||
index 07df6765d9db..d9bf68bb369e 100644
|
||||
index 07df6765d..d9bf68bb3 100644
|
||||
--- a/llvm/include/llvm/Support/Errno.h
|
||||
+++ b/llvm/include/llvm/Support/Errno.h
|
||||
@@ -20,15 +20,6 @@
|
||||
@@ -136,10 +136,18 @@ index 07df6765d9db..d9bf68bb369e 100644
|
||||
inline decltype(auto) RetryAfterSignal(const FailT &Fail, const Fun &F,
|
||||
const Args &... As) {
|
||||
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
|
||||
index 85f4f1a707c7..a28e12adcc25 100644
|
||||
index 3d6573bf5..a28e12adc 100644
|
||||
--- a/llvm/include/llvm/Support/VersionTuple.h
|
||||
+++ b/llvm/include/llvm/Support/VersionTuple.h
|
||||
@@ -158,39 +158,6 @@ public:
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "llvm/ADT/DenseMapInfo.h"
|
||||
#include "llvm/ADT/Hashing.h"
|
||||
-#include "llvm/Support/HashBuilder.h"
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
@@ -159,45 +158,6 @@ public:
|
||||
friend bool operator>=(const VersionTuple &X, const VersionTuple &Y) {
|
||||
return !(X < Y);
|
||||
}
|
||||
@@ -148,6 +156,12 @@ index 85f4f1a707c7..a28e12adcc25 100644
|
||||
- return llvm::hash_combine(VT.Major, VT.Minor, VT.Subminor, VT.Build);
|
||||
- }
|
||||
-
|
||||
- template <typename HasherT, llvm::support::endianness Endianness>
|
||||
- friend void addHash(HashBuilderImpl<HasherT, Endianness> &HBuilder,
|
||||
- const VersionTuple &VT) {
|
||||
- HBuilder.add(VT.Major, VT.Minor, VT.Subminor, VT.Build);
|
||||
- }
|
||||
-
|
||||
- /// Retrieve a string representation of the version number.
|
||||
- std::string getAsString() const;
|
||||
-};
|
||||
@@ -180,10 +194,10 @@ index 85f4f1a707c7..a28e12adcc25 100644
|
||||
|
||||
} // end namespace llvm
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 94d0ed66eced..50443e018aaf 100644
|
||||
index a25ca5b7b..d4521c8e2 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -249,32 +249,6 @@ public:
|
||||
@@ -248,32 +248,6 @@ public:
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
|
||||
@@ -216,7 +230,7 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
/// Output \p Str, turning '\\', '\t', '\n', '"', and anything that doesn't
|
||||
/// satisfy llvm::isPrint into an escape sequence.
|
||||
raw_ostream &write_escaped(std::string_view Str, bool UseHexEscapes = false);
|
||||
@@ -282,21 +256,6 @@ public:
|
||||
@@ -281,21 +255,6 @@ public:
|
||||
raw_ostream &write(unsigned char C);
|
||||
raw_ostream &write(const char *Ptr, size_t Size);
|
||||
|
||||
@@ -238,7 +252,7 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
/// indent - Insert 'NumSpaces' spaces.
|
||||
raw_ostream &indent(unsigned NumSpaces);
|
||||
|
||||
@@ -311,14 +270,19 @@ public:
|
||||
@@ -310,14 +269,19 @@ public:
|
||||
/// @param BG if true change the background, default: change foreground
|
||||
/// @returns itself so it can be used within << invocations
|
||||
virtual raw_ostream &changeColor(enum Colors Color, bool Bold = false,
|
||||
@@ -261,7 +275,7 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
|
||||
/// This function determines if this stream is connected to a "tty" or
|
||||
/// "console" window. That is, the output would be displayed to the user
|
||||
@@ -391,10 +355,6 @@ private:
|
||||
@@ -392,10 +356,6 @@ private:
|
||||
/// unused bytes in the buffer.
|
||||
void copy_to_buffer(const char *Ptr, size_t Size);
|
||||
|
||||
@@ -272,15 +286,15 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
/// Flush the tied-to stream (if present) and then write the required data.
|
||||
void flush_tied_then_write(const char *Ptr, size_t Size);
|
||||
|
||||
@@ -445,7 +405,6 @@ class raw_fd_ostream : public raw_pwrite_stream {
|
||||
int FD;
|
||||
@@ -447,7 +407,6 @@ class raw_fd_ostream : public raw_pwrite_stream {
|
||||
bool ShouldClose;
|
||||
bool SupportsSeeking = false;
|
||||
- mutable Optional<bool> HasColors;
|
||||
bool IsRegularFile = false;
|
||||
- mutable std::optional<bool> HasColors;
|
||||
|
||||
#ifdef _WIN32
|
||||
/// True if this fd refers to a Windows console device. Mintty and other
|
||||
@@ -519,10 +478,6 @@ public:
|
||||
@@ -523,10 +482,6 @@ public:
|
||||
/// to the offset specified from the beginning of the file.
|
||||
uint64_t seek(uint64_t off);
|
||||
|
||||
@@ -291,7 +305,7 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
std::error_code error() const { return EC; }
|
||||
|
||||
/// Return the value of the flag in this raw_fd_ostream indicating whether an
|
||||
@@ -541,38 +496,6 @@ public:
|
||||
@@ -545,38 +500,6 @@ public:
|
||||
/// - from The Zen of Python, by Tim Peters
|
||||
///
|
||||
void clear_error() { EC = std::error_code(); }
|
||||
@@ -326,11 +340,11 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
- ///
|
||||
- /// It is used as @ref lock.
|
||||
- LLVM_NODISCARD
|
||||
- Expected<sys::fs::FileLocker> tryLockFor(std::chrono::milliseconds Timeout);
|
||||
- Expected<sys::fs::FileLocker> tryLockFor(Duration const& Timeout);
|
||||
};
|
||||
|
||||
/// This returns a reference to a raw_fd_ostream for standard output. Use it
|
||||
@@ -602,17 +525,6 @@ public:
|
||||
@@ -606,17 +529,6 @@ public:
|
||||
/// immediately destroyed.
|
||||
raw_fd_stream(std::string_view Filename, std::error_code &EC);
|
||||
|
||||
@@ -348,7 +362,7 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
/// Check if \p OS is a pointer of type raw_fd_stream*.
|
||||
static bool classof(const raw_ostream *OS);
|
||||
};
|
||||
@@ -726,17 +638,6 @@ public:
|
||||
@@ -734,17 +646,6 @@ public:
|
||||
~buffer_unique_ostream() override { *OS << str(); }
|
||||
};
|
||||
|
||||
@@ -367,10 +381,18 @@ index 94d0ed66eced..50443e018aaf 100644
|
||||
|
||||
#endif // LLVM_SUPPORT_RAW_OSTREAM_H
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index bff7b6c9a77b..611043dc5925 100644
|
||||
index ee01a9522..875eda7ba 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -121,49 +121,6 @@ void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size,
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Config/config.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
-#include "llvm/Support/Duration.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
@@ -120,49 +119,6 @@ void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size,
|
||||
assert(OutBufStart <= OutBufEnd && "Invalid size!");
|
||||
}
|
||||
|
||||
@@ -420,7 +442,7 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
raw_ostream &raw_ostream::write_escaped(std::string_view Str,
|
||||
bool UseHexEscapes) {
|
||||
for (unsigned char c : Str) {
|
||||
@@ -309,172 +266,6 @@ void raw_ostream::flush_tied_then_write(const char *Ptr, size_t Size) {
|
||||
@@ -308,172 +264,6 @@ void raw_ostream::flush_tied_then_write(const char *Ptr, size_t Size) {
|
||||
write_impl(Ptr, Size);
|
||||
}
|
||||
|
||||
@@ -593,7 +615,7 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
|
||||
template <char C>
|
||||
static raw_ostream &write_padding(raw_ostream &OS, unsigned NumChars) {
|
||||
@@ -507,63 +298,8 @@ raw_ostream &raw_ostream::write_zeros(unsigned NumZeros) {
|
||||
@@ -506,63 +296,8 @@ raw_ostream &raw_ostream::write_zeros(unsigned NumZeros) {
|
||||
return write_padding<'\0'>(*this, NumZeros);
|
||||
}
|
||||
|
||||
@@ -657,7 +679,7 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
//===----------------------------------------------------------------------===//
|
||||
// raw_fd_ostream
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -854,31 +590,6 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
|
||||
@@ -854,31 +589,6 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -679,8 +701,8 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
-}
|
||||
-
|
||||
-Expected<sys::fs::FileLocker>
|
||||
-raw_fd_ostream::tryLockFor(std::chrono::milliseconds Timeout) {
|
||||
- std::error_code EC = sys::fs::tryLockFile(FD, Timeout);
|
||||
-raw_fd_ostream::tryLockFor(Duration const& Timeout) {
|
||||
- std::error_code EC = sys::fs::tryLockFile(FD, Timeout.getDuration());
|
||||
- if (!EC)
|
||||
- return sys::fs::FileLocker(FD);
|
||||
- return errorCodeToError(EC);
|
||||
@@ -689,7 +711,7 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
void raw_fd_ostream::anchor() {}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -922,16 +633,6 @@ raw_fd_stream::raw_fd_stream(std::string_view Filename, std::error_code &EC)
|
||||
@@ -921,16 +631,6 @@ raw_fd_stream::raw_fd_stream(std::string_view Filename, std::error_code &EC)
|
||||
EC = std::make_error_code(std::errc::invalid_argument);
|
||||
}
|
||||
|
||||
@@ -706,7 +728,7 @@ index bff7b6c9a77b..611043dc5925 100644
|
||||
bool raw_fd_stream::classof(const raw_ostream *OS) {
|
||||
return OS->get_kind() == OStreamKind::OK_FDStream;
|
||||
}
|
||||
@@ -991,31 +692,3 @@ void raw_pwrite_stream::anchor() {}
|
||||
@@ -986,31 +686,3 @@ void raw_pwrite_stream::anchor() {}
|
||||
void buffer_ostream::anchor() {}
|
||||
|
||||
void buffer_unique_ostream::anchor() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0afb3b1de99d7f85899d3907e5e9a503a6ac599a Mon Sep 17 00:00:00 2001
|
||||
From ef26f059859d3a0d08b06a70519928bcd5f9bb79 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Thu, 5 May 2022 23:18:34 -0400
|
||||
Subject: [PATCH 11/27] Detemplatize small vector base
|
||||
Subject: [PATCH 11/28] Detemplatize SmallVectorBase
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallVector.h | 21 +++++++-----------
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 11/27] Detemplatize small vector base
|
||||
2 files changed, 13 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index 690d512a43c8..695015ae3248 100644
|
||||
index 1e311ea56..4b6bbdeb2 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -50,14 +50,14 @@ namespace llvm {
|
||||
@@ -50,14 +50,14 @@ template <typename IteratorT> class iterator_range;
|
||||
/// Using 64 bit size is desirable for cases like SmallVector<char>, where a
|
||||
/// 32 bit size would limit the vector to ~4GB. SmallVectors are used for
|
||||
/// buffering bitcode output - which can exceed 4GB.
|
||||
@@ -30,7 +30,7 @@ index 690d512a43c8..695015ae3248 100644
|
||||
}
|
||||
|
||||
SmallVectorBase() = delete;
|
||||
@@ -95,15 +95,10 @@ public:
|
||||
@@ -91,15 +91,10 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ index 690d512a43c8..695015ae3248 100644
|
||||
alignas(T) char FirstEl[sizeof(T)];
|
||||
};
|
||||
|
||||
@@ -112,8 +107,8 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
@@ -108,8 +103,8 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
/// to avoid unnecessarily requiring T to be complete.
|
||||
template <typename T, typename = void>
|
||||
class SmallVectorTemplateCommon
|
||||
@@ -59,7 +59,7 @@ index 690d512a43c8..695015ae3248 100644
|
||||
|
||||
/// Find the address of the first element. For this pointer math to be valid
|
||||
/// with small-size of 0 for T with lots of alignment, it's important that
|
||||
@@ -360,7 +355,7 @@ protected:
|
||||
@@ -356,7 +351,7 @@ protected:
|
||||
/// in \p NewCapacity. This is the first section of \a grow().
|
||||
T *mallocForGrow(size_t MinSize, size_t &NewCapacity) {
|
||||
return static_cast<T *>(
|
||||
@@ -69,10 +69,10 @@ index 690d512a43c8..695015ae3248 100644
|
||||
}
|
||||
|
||||
diff --git a/llvm/lib/Support/SmallVector.cpp b/llvm/lib/Support/SmallVector.cpp
|
||||
index 26901fe97d20..3fc16097bd30 100644
|
||||
index a2b4899e1..bdfc963d7 100644
|
||||
--- a/llvm/lib/Support/SmallVector.cpp
|
||||
+++ b/llvm/lib/Support/SmallVector.cpp
|
||||
@@ -41,10 +41,6 @@ static_assert(sizeof(SmallVector<void *, 1>) ==
|
||||
@@ -51,10 +51,6 @@ static_assert(sizeof(SmallVector<void *, 1>) ==
|
||||
sizeof(unsigned) * 2 + sizeof(void *) * 2,
|
||||
"wasted space in SmallVector size 1");
|
||||
|
||||
@@ -82,8 +82,8 @@ index 26901fe97d20..3fc16097bd30 100644
|
||||
-
|
||||
/// Report that MinSize doesn't fit into this vector's size type. Throws
|
||||
/// std::length_error or calls report_fatal_error.
|
||||
LLVM_ATTRIBUTE_NORETURN
|
||||
@@ -76,9 +72,8 @@ static void report_at_maximum_capacity(size_t MaxSize) {
|
||||
[[noreturn]] static void report_size_overflow(size_t MinSize, size_t MaxSize);
|
||||
@@ -85,9 +81,8 @@ static void report_at_maximum_capacity(size_t MaxSize) {
|
||||
}
|
||||
|
||||
// Note: Moving this function into the header may cause performance regression.
|
||||
@@ -94,7 +94,7 @@ index 26901fe97d20..3fc16097bd30 100644
|
||||
|
||||
// Ensure we can fit the new capacity.
|
||||
// This is only going to be applicable when the capacity is 32 bit.
|
||||
@@ -99,18 +94,16 @@ static size_t getNewCapacity(size_t MinSize, size_t TSize, size_t OldCapacity) {
|
||||
@@ -108,18 +103,16 @@ static size_t getNewCapacity(size_t MinSize, size_t TSize, size_t OldCapacity) {
|
||||
}
|
||||
|
||||
// Note: Moving this function into the header may cause performance regression.
|
||||
@@ -117,7 +117,7 @@ index 26901fe97d20..3fc16097bd30 100644
|
||||
void *NewElts;
|
||||
if (BeginX == FirstEl) {
|
||||
NewElts = safe_malloc(NewCapacity * TSize);
|
||||
@@ -125,20 +118,3 @@ void SmallVectorBase<Size_T>::grow_pod(void *FirstEl, size_t MinSize,
|
||||
@@ -134,20 +127,3 @@ void SmallVectorBase<Size_T>::grow_pod(void *FirstEl, size_t MinSize,
|
||||
this->BeginX = NewElts;
|
||||
this->Capacity = NewCapacity;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
From c01b703c5d54cb57f8a73215a4ca8aded32dd9ba Mon Sep 17 00:00:00 2001
|
||||
From 342ebd445bb3dae8b0c119a6126a318ad378a377 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:48:59 -0400
|
||||
Subject: [PATCH 12/27] Add vectors to raw_ostream
|
||||
Subject: [PATCH 12/28] Add vectors to raw_ostream
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/raw_ostream.h | 115 ++++++++++++++++++++++++
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 12/27] Add vectors to raw_ostream
|
||||
2 files changed, 162 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 50443e018aaf..8008170be3e5 100644
|
||||
index d4521c8e2..bf5630ab5 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -26,6 +26,7 @@
|
||||
@@ -25,6 +25,7 @@
|
||||
#endif
|
||||
#include <system_error>
|
||||
#include <type_traits>
|
||||
@@ -20,7 +20,7 @@ index 50443e018aaf..8008170be3e5 100644
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -249,12 +250,24 @@ public:
|
||||
@@ -248,12 +249,24 @@ public:
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ index 50443e018aaf..8008170be3e5 100644
|
||||
|
||||
/// indent - Insert 'NumSpaces' spaces.
|
||||
raw_ostream &indent(unsigned NumSpaces);
|
||||
@@ -600,6 +613,108 @@ public:
|
||||
@@ -604,6 +617,108 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -155,10 +155,10 @@ index 50443e018aaf..8008170be3e5 100644
|
||||
class raw_null_ostream : public raw_pwrite_stream {
|
||||
/// See raw_ostream::write_impl.
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 611043dc5925..3abeed3dac21 100644
|
||||
index 875eda7ba..36faf744c 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -664,6 +664,53 @@ void raw_svector_ostream::pwrite_impl(const char *Ptr, size_t Size,
|
||||
@@ -658,6 +658,53 @@ void raw_svector_ostream::pwrite_impl(const char *Ptr, size_t Size,
|
||||
memcpy(OS.data() + Offset, Ptr, Size);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 1c2a3d6eb4737e5b822ca8729472ddcf5c4d78c2 Mon Sep 17 00:00:00 2001
|
||||
From 5db7e9f9370a5e04949846cc68eeb13e2c1db187 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 22:16:10 -0400
|
||||
Subject: [PATCH 13/27] Extra collections features
|
||||
Subject: [PATCH 13/28] Extra collections features
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/StringMap.h | 103 +++++++++++++++++++++++++++++-
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 13/27] Extra collections features
|
||||
2 files changed, 110 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
|
||||
index 5f463cfef943..ac0d4b363145 100644
|
||||
index 8747cdb35..16f13f048 100644
|
||||
--- a/llvm/include/llvm/ADT/StringMap.h
|
||||
+++ b/llvm/include/llvm/ADT/StringMap.h
|
||||
@@ -40,7 +40,7 @@ protected:
|
||||
@@ -42,7 +42,7 @@ protected:
|
||||
|
||||
protected:
|
||||
explicit StringMapImpl(unsigned itemSize) : ItemSize(itemSize) {}
|
||||
@@ -21,7 +21,7 @@ index 5f463cfef943..ac0d4b363145 100644
|
||||
: TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets),
|
||||
NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones),
|
||||
ItemSize(RHS.ItemSize) {
|
||||
@@ -405,11 +405,27 @@ public:
|
||||
@@ -420,11 +420,27 @@ public:
|
||||
return Tmp;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ index 5f463cfef943..ac0d4b363145 100644
|
||||
};
|
||||
|
||||
template <typename ValueTy>
|
||||
@@ -474,6 +490,91 @@ private:
|
||||
std::string_view Key;
|
||||
@@ -483,6 +499,91 @@ public:
|
||||
std::string_view operator*() const { return this->wrapped()->getKey(); }
|
||||
};
|
||||
|
||||
+template <typename ValueTy>
|
||||
@@ -142,10 +142,10 @@ index 5f463cfef943..ac0d4b363145 100644
|
||||
|
||||
#endif // LLVM_ADT_STRINGMAP_H
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 3abeed3dac21..27bba0ca2f06 100644
|
||||
index 36faf744c..95152849c 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -78,6 +78,14 @@ constexpr raw_ostream::Colors raw_ostream::WHITE;
|
||||
@@ -76,6 +76,14 @@ constexpr raw_ostream::Colors raw_ostream::WHITE;
|
||||
constexpr raw_ostream::Colors raw_ostream::SAVEDCOLOR;
|
||||
constexpr raw_ostream::Colors raw_ostream::RESET;
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 72ab19d035da6d31695f3622270978608d7ef0ef Mon Sep 17 00:00:00 2001
|
||||
From 9951c4b3fea6b2dbe7141070444de8df6ae4ce9b Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Wed, 4 May 2022 00:01:00 -0400
|
||||
Subject: [PATCH 14/27] EpochTracker abi macro
|
||||
Subject: [PATCH 14/28] EpochTracker ABI macro
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/EpochTracker.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h
|
||||
index 7a2e4220afec..8f98f3d582c7 100644
|
||||
index b06888494..f35461d1c 100644
|
||||
--- a/llvm/include/llvm/ADT/EpochTracker.h
|
||||
+++ b/llvm/include/llvm/ADT/EpochTracker.h
|
||||
@@ -21,7 +21,7 @@
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From bb8c33904fba6099ca17ddecd84fa20272c5a20c Mon Sep 17 00:00:00 2001
|
||||
From 907608f09061ab272b0a127330b1b24e28d50a9f Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Thu, 5 May 2022 18:09:45 -0400
|
||||
Subject: [PATCH 15/27] Delete numbers from mathextras
|
||||
Subject: [PATCH 15/28] Delete numbers from MathExtras
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/MathExtras.h | 36 --------------------------
|
||||
1 file changed, 36 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index fac12dd0e4c6..e8f1f2aca610 100644
|
||||
index fac12dd0e..e8f1f2aca 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -50,42 +50,6 @@ enum ZeroBehavior {
|
||||
@@ -1,14 +1,14 @@
|
||||
From 08f507c2c558f3ae9fcd7a31c7ce33b0776bfe8a Mon Sep 17 00:00:00 2001
|
||||
From 9ef10e5b331d00d7d5822afdb70c1f2d9981d772 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 22:50:24 -0400
|
||||
Subject: [PATCH 16/27] Add lerp and sgn
|
||||
Subject: [PATCH 16/28] Add lerp and sgn
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/MathExtras.h | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index e8f1f2aca610..8116c58bd0d6 100644
|
||||
index e8f1f2aca..8116c58bd 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -930,6 +930,26 @@ std::enable_if_t<std::is_signed<T>::value, T> MulOverflow(T X, T Y, T &Result) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 8e868fdb545f3facb646418b5e127e360fe88a99 Mon Sep 17 00:00:00 2001
|
||||
From aa30b80d86cb0774efc094646339b54694ab8398 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
|
||||
Subject: [PATCH 17/28] Fixup includes
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/StringMap.h | 4 ++++
|
||||
@@ -16,12 +16,12 @@ Subject: [PATCH 17/27] Fixup includes
|
||||
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
|
||||
index 16f13f048..6ae0e39a1 100644
|
||||
--- a/llvm/include/llvm/ADT/StringMap.h
|
||||
+++ b/llvm/include/llvm/ADT/StringMap.h
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#include "llvm/ADT/StringMapEntry.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/Support/AllocatorBase.h"
|
||||
+#include "llvm/Support/MemAlloc.h"
|
||||
+#include "llvm/Support/SmallVector.h"
|
||||
@@ -31,10 +31,10 @@ index ac0d4b363145..f7bf5ad9c063 100644
|
||||
#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
|
||||
index 39976a02b..cdefc5449 100644
|
||||
--- a/llvm/include/llvm/ADT/StringMapEntry.h
|
||||
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
|
||||
@@ -15,6 +15,10 @@
|
||||
@@ -16,6 +16,10 @@
|
||||
#ifndef LLVM_ADT_STRINGMAPENTRY_H
|
||||
#define LLVM_ADT_STRINGMAPENTRY_H
|
||||
|
||||
@@ -46,7 +46,7 @@ index 93e13b5bb16c..cdf11d627200 100644
|
||||
#include <string_view>
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
|
||||
index 1b15f930bd87..acadd5e89a16 100644
|
||||
index 1b15f930b..acadd5e89 100644
|
||||
--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
|
||||
+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -58,7 +58,7 @@ index 1b15f930bd87..acadd5e89a16 100644
|
||||
|
||||
namespace llvm {
|
||||
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
index 090ebb0f5af8..87da616b75d4 100644
|
||||
index 396ab0c65..cff30f16c 100644
|
||||
--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -70,7 +70,7 @@ index 090ebb0f5af8..87da616b75d4 100644
|
||||
#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
|
||||
index f80e28e87..ec1a1633a 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -28,12 +28,11 @@
|
||||
@@ -90,20 +90,20 @@ index 9c0c6fb868f2..4b6ddd30c6e4 100644
|
||||
|
||||
using namespace llvm;
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 27bba0ca2f06..6b9e5f9e44bd 100644
|
||||
index 95152849c..878a3a5e9 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 "llvm/ADT/STLArrayExtras.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 @@
|
||||
@@ -33,12 +34,11 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
// <fcntl.h> may provide O_BINARY.
|
||||
@@ -119,7 +119,7 @@ index 27bba0ca2f06..6b9e5f9e44bd 100644
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
@@ -62,7 +62,7 @@
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "llvm/Support/ConvertUTF.h"
|
||||
@@ -129,7 +129,7 @@ index 27bba0ca2f06..6b9e5f9e44bd 100644
|
||||
|
||||
using namespace llvm;
|
||||
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
index 531f81ab5b3f..3db8b6e37d31 100644
|
||||
index 531f81ab5..3db8b6e37 100644
|
||||
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
@@ -15,6 +15,8 @@
|
||||
@@ -142,7 +142,7 @@ index 531f81ab5b3f..3db8b6e37d31 100644
|
||||
|
||||
TEST(SmallPtrSetTest, Assignment) {
|
||||
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
index 081b699adee3..64bb8f85c4b9 100644
|
||||
index 6d0c0942c..de6daf3da 100644
|
||||
--- a/llvm/unittests/ADT/StringMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -154,7 +154,7 @@ index 081b699adee3..64bb8f85c4b9 100644
|
||||
#include <tuple>
|
||||
using namespace llvm;
|
||||
diff --git a/llvm/unittests/Support/ConvertUTFTest.cpp b/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
index 9c798437a12d..2fee8ad5c012 100644
|
||||
index 9c798437a..2fee8ad5c 100644
|
||||
--- a/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
+++ b/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 024847ab39cbe06024da3f5c63d9a667aff4e500 Mon Sep 17 00:00:00 2001
|
||||
From 1c3e8a6ff8d8b6c054141503c7318d69319d8d41 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:42:09 -0400
|
||||
Subject: [PATCH 18/27] use std is_trivially_copy_constructible
|
||||
Subject: [PATCH 18/28] Use std::is_trivially_copy_constructible
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/PointerIntPair.h | 12 ----
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 18/27] use std is_trivially_copy_constructible
|
||||
2 files changed, 2 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
index cb8b202c48b7..f9c4d2dd14c7 100644
|
||||
index b7ddf8855..a48fb904b 100644
|
||||
--- a/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
+++ b/llvm/include/llvm/ADT/PointerIntPair.h
|
||||
@@ -127,18 +127,6 @@ public:
|
||||
@@ -128,18 +128,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ index cb8b202c48b7..f9c4d2dd14c7 100644
|
||||
template <typename PointerT, unsigned IntBits, typename PtrTraits>
|
||||
struct PointerIntPairInfo {
|
||||
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
|
||||
index 7b7d5d991f3f..72a2e84ad452 100644
|
||||
index 7b7d5d991..72a2e84ad 100644
|
||||
--- a/llvm/include/llvm/Support/type_traits.h
|
||||
+++ b/llvm/include/llvm/Support/type_traits.h
|
||||
@@ -92,98 +92,11 @@ union trivial_helper {
|
||||
@@ -1,16 +1,15 @@
|
||||
From 45d53c5dc0cc2924569a96c1ac1e4efcaaa60044 Mon Sep 17 00:00:00 2001
|
||||
From 36f7f08e257f2b58b2894f165a38ff2a831aed8f Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 20:22:38 -0400
|
||||
Subject: [PATCH 19/27] Windows Support
|
||||
Subject: [PATCH 19/28] Windows support
|
||||
|
||||
---
|
||||
.../llvm/Support/Windows/WindowsSupport.h | 45 +++++----
|
||||
llvm/lib/Support/ConvertUTF.cpp | 95 +++++++++++++++++++
|
||||
llvm/lib/Support/MemoryBuffer.cpp | 4 +-
|
||||
3 files changed, 126 insertions(+), 18 deletions(-)
|
||||
2 files changed, 124 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Windows/WindowsSupport.h b/llvm/include/llvm/Support/Windows/WindowsSupport.h
|
||||
index 551bd199551e..50b0843beb29 100644
|
||||
index 180803fbd..31120cfa0 100644
|
||||
--- a/llvm/include/llvm/Support/Windows/WindowsSupport.h
|
||||
+++ b/llvm/include/llvm/Support/Windows/WindowsSupport.h
|
||||
@@ -35,8 +35,6 @@
|
||||
@@ -91,7 +90,7 @@ index 551bd199551e..50b0843beb29 100644
|
||||
} // end namespace llvm.
|
||||
|
||||
diff --git a/llvm/lib/Support/ConvertUTF.cpp b/llvm/lib/Support/ConvertUTF.cpp
|
||||
index e24a918c5c89..b4c7fffee8f7 100644
|
||||
index e24a918c5..c906ded91 100644
|
||||
--- a/llvm/lib/Support/ConvertUTF.cpp
|
||||
+++ b/llvm/lib/Support/ConvertUTF.cpp
|
||||
@@ -51,6 +51,11 @@
|
||||
@@ -126,7 +125,7 @@ index e24a918c5c89..b4c7fffee8f7 100644
|
||||
+ }
|
||||
+
|
||||
+ utf16.reserve(len + 1);
|
||||
+ utf16.set_size(len);
|
||||
+ utf16.resize_for_overwrite(len);
|
||||
+
|
||||
+ len = ::MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, original.data(),
|
||||
+ original.size(), utf16.begin(), utf16.size());
|
||||
@@ -167,7 +166,7 @@ index e24a918c5c89..b4c7fffee8f7 100644
|
||||
+ }
|
||||
+
|
||||
+ converted.reserve(len);
|
||||
+ converted.set_size(len);
|
||||
+ converted.resize_for_overwrite(len);
|
||||
+
|
||||
+ // Now do the actual conversion.
|
||||
+ len = ::WideCharToMultiByte(codepage, 0, utf16, utf16_len, converted.data(),
|
||||
@@ -203,18 +202,3 @@ index e24a918c5c89..b4c7fffee8f7 100644
|
||||
} // namespace llvm
|
||||
|
||||
ConvertUTF_RESTORE_WARNINGS
|
||||
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
|
||||
index bcf13d828a5d..cddad9ca0660 100644
|
||||
--- a/llvm/lib/Support/MemoryBuffer.cpp
|
||||
+++ b/llvm/lib/Support/MemoryBuffer.cpp
|
||||
@@ -225,8 +225,8 @@ public:
|
||||
|
||||
static ErrorOr<std::unique_ptr<WritableMemoryBuffer>>
|
||||
getMemoryBufferForStream(sys::fs::file_t FD, const Twine &BufferName) {
|
||||
- const ssize_t ChunkSize = 4096*4;
|
||||
- SmallString<ChunkSize> Buffer;
|
||||
+ constexpr size_t ChunkSize = 4096*4;
|
||||
+ SmallVector<uint8_t, ChunkSize> Buffer;
|
||||
// Read into Buffer until we hit EOF.
|
||||
for (;;) {
|
||||
Buffer.reserve(Buffer.size() + ChunkSize);
|
||||
@@ -1,14 +1,14 @@
|
||||
From 2a480ee8e89b322b91f596a5a9d63aa6b9a76af0 Mon Sep 17 00:00:00 2001
|
||||
From 8834260a9ee172311cc08d0b4e4e958bf36a260f Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:46:20 -0400
|
||||
Subject: [PATCH 20/27] Prefer fmtlib
|
||||
Subject: [PATCH 20/28] Prefer fmtlib
|
||||
|
||||
---
|
||||
llvm/lib/Support/ErrorHandling.cpp | 20 ++++++--------------
|
||||
1 file changed, 6 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 4b6ddd30c6e4..9ee52a02c214 100644
|
||||
index ec1a1633a..8de7b726d 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -22,7 +22,7 @@
|
||||
@@ -22,7 +22,7 @@ index 4b6ddd30c6e4..9ee52a02c214 100644
|
||||
#include <mutex>
|
||||
@@ -93,15 +93,7 @@ void llvm::report_fatal_error(std::string_view Reason, bool GenCrashDiag) {
|
||||
if (handler) {
|
||||
handler(handlerData, std::string{Reason}, GenCrashDiag);
|
||||
handler(handlerData, std::string{Reason}.c_str(), GenCrashDiag);
|
||||
} else {
|
||||
- // Blast the result out to stderr. We don't try hard to make sure this
|
||||
- // succeeds (e.g. handling EINTR) and we can't use errs() here because
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From c7a7fd016ae0636dcadc65705a9260f02c509495 Mon Sep 17 00:00:00 2001
|
||||
From 7943842aea1a05a1dd2c2c753378af569c24293b Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:49:36 -0400
|
||||
Subject: [PATCH 21/27] prefer wpi's fs.h
|
||||
Subject: [PATCH 21/28] Prefer wpi's fs.h
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/raw_ostream.h | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 8008170be3e5..27fb5c03e474 100644
|
||||
index bf5630ab5..256bcec25 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -28,18 +28,15 @@
|
||||
@@ -27,18 +27,15 @@
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
From 8536e1f23d515eac3cbc0680f27aa6ab740b4796 Mon Sep 17 00:00:00 2001
|
||||
From a172c93df929ac6c9f783fd5af1e4df3604c4c66 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 19:16:51 -0400
|
||||
Subject: [PATCH 22/27] Remove unused functions
|
||||
Subject: [PATCH 22/28] Remove unused functions
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/DJB.h | 3 -
|
||||
llvm/include/llvm/Support/raw_ostream.h | 3 +-
|
||||
llvm/include/llvm/Support/raw_ostream.h | 5 +-
|
||||
llvm/lib/Support/ErrorHandling.cpp | 16 -----
|
||||
llvm/lib/Support/raw_ostream.cpp | 48 +++++++--------
|
||||
llvm/lib/Support/raw_ostream.cpp | 49 +++++++--------
|
||||
llvm/unittests/ADT/SmallStringTest.cpp | 81 -------------------------
|
||||
5 files changed, 22 insertions(+), 129 deletions(-)
|
||||
5 files changed, 23 insertions(+), 131 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/DJB.h b/llvm/include/llvm/Support/DJB.h
|
||||
index 8737cd144c37..67b0ae91b4b1 100644
|
||||
index 8737cd144..67b0ae91b 100644
|
||||
--- a/llvm/include/llvm/Support/DJB.h
|
||||
+++ b/llvm/include/llvm/Support/DJB.h
|
||||
@@ -24,9 +24,6 @@ inline uint32_t djbHash(std::string_view Buffer, uint32_t H = 5381) {
|
||||
@@ -26,10 +26,10 @@ index 8737cd144c37..67b0ae91b4b1 100644
|
||||
|
||||
#endif // LLVM_SUPPORT_DJB_H
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 27fb5c03e474..d228b05f4f9b 100644
|
||||
index 256bcec25..9b3a87e1b 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -72,7 +72,6 @@ private:
|
||||
@@ -71,7 +71,6 @@ private:
|
||||
/// for a \see write_impl() call to handle the data which has been put into
|
||||
/// this buffer.
|
||||
char *OutBufStart, *OutBufEnd, *OutBufCur;
|
||||
@@ -37,28 +37,31 @@ index 27fb5c03e474..d228b05f4f9b 100644
|
||||
|
||||
/// Optional stream this stream is tied to. If this stream is written to, the
|
||||
/// tied-to stream will be flushed first.
|
||||
@@ -305,7 +304,7 @@ public:
|
||||
@@ -304,9 +303,9 @@ public:
|
||||
|
||||
// Enable or disable colors. Once enable_colors(false) is called,
|
||||
// changeColor() has no effect until enable_colors(true) is called.
|
||||
- virtual void enable_colors(bool enable) { ColorEnabled = enable; }
|
||||
+ virtual void enable_colors(bool /*enable*/) {}
|
||||
|
||||
- bool colors_enabled() const { return ColorEnabled; }
|
||||
+ bool colors_enabled() const { return false; }
|
||||
|
||||
/// Tie this stream to the specified stream. Replaces any existing tied-to
|
||||
/// stream. Specifying a nullptr unties the stream.
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 9ee52a02c214..77c3a37475d0 100644
|
||||
index 8de7b726d..bc08199a1 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -178,22 +178,6 @@ void llvm::llvm_unreachable_internal(const char *msg, const char *file,
|
||||
#endif
|
||||
}
|
||||
|
||||
-static void bindingsErrorHandler(void *user_data, const std::string& reason,
|
||||
-static void bindingsErrorHandler(void *user_data, const char *reason,
|
||||
- bool gen_crash_diag) {
|
||||
- LLVMFatalErrorHandler handler =
|
||||
- LLVM_EXTENSION reinterpret_cast<LLVMFatalErrorHandler>(user_data);
|
||||
- handler(reason.c_str());
|
||||
- handler(reason);
|
||||
-}
|
||||
-
|
||||
-void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler) {
|
||||
@@ -74,10 +77,10 @@ index 9ee52a02c214..77c3a37475d0 100644
|
||||
|
||||
#include <winerror.h>
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
index 878a3a5e9..632b52235 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -169,16 +169,6 @@ raw_ostream &raw_ostream::write_escaped(std::string_view Str,
|
||||
@@ -167,16 +167,6 @@ raw_ostream &raw_ostream::write_escaped(std::string_view Str,
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -94,7 +97,7 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
void raw_ostream::flush_nonempty() {
|
||||
assert(OutBufCur > OutBufStart && "Invalid call to flush_nonempty.");
|
||||
size_t Length = OutBufCur - OutBufStart;
|
||||
@@ -323,15 +313,22 @@ static int getFD(std::string_view Filename, std::error_code &EC,
|
||||
@@ -321,15 +311,22 @@ static int getFD(std::string_view Filename, std::error_code &EC,
|
||||
if (Filename == "-") {
|
||||
EC = std::error_code();
|
||||
// Change stdout's text/binary mode based on the Flags.
|
||||
@@ -122,19 +125,21 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
if (EC)
|
||||
return -1;
|
||||
|
||||
@@ -392,10 +389,7 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered,
|
||||
@@ -389,12 +386,8 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered,
|
||||
|
||||
// Get the starting position.
|
||||
off_t loc = ::lseek(FD, 0, SEEK_CUR);
|
||||
#ifdef _WIN32
|
||||
- // MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for pipes.
|
||||
- sys::fs::file_status Status;
|
||||
- std::error_code EC = status(FD, Status);
|
||||
- SupportsSeeking = !EC && Status.type() == sys::fs::file_type::regular_file;
|
||||
- IsRegularFile = Status.type() == sys::fs::file_type::regular_file;
|
||||
#ifdef _WIN32
|
||||
- // MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for pipes.
|
||||
- SupportsSeeking = !EC && IsRegularFile;
|
||||
+ SupportsSeeking = loc != (off_t)-1 && ::GetFileType(reinterpret_cast<HANDLE>(::_get_osfhandle(FD))) != FILE_TYPE_PIPE;
|
||||
#else
|
||||
SupportsSeeking = loc != (off_t)-1;
|
||||
SupportsSeeking = !EC && loc != (off_t)-1;
|
||||
#endif
|
||||
@@ -408,10 +402,8 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered,
|
||||
@@ -407,10 +400,8 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered,
|
||||
raw_fd_ostream::~raw_fd_ostream() {
|
||||
if (FD >= 0) {
|
||||
flush();
|
||||
@@ -147,7 +152,7 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
@@ -506,7 +498,11 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
@@ -505,7 +496,11 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
|
||||
do {
|
||||
size_t ChunkSize = std::min(Size, MaxWriteSize);
|
||||
@@ -159,7 +164,7 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
|
||||
if (ret < 0) {
|
||||
// If it's a recoverable error, swallow it and retry the write.
|
||||
@@ -541,8 +537,8 @@ void raw_fd_ostream::close() {
|
||||
@@ -540,8 +535,8 @@ void raw_fd_ostream::close() {
|
||||
assert(ShouldClose);
|
||||
ShouldClose = false;
|
||||
flush();
|
||||
@@ -170,7 +175,7 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
FD = -1;
|
||||
}
|
||||
|
||||
@@ -551,8 +547,6 @@ uint64_t raw_fd_ostream::seek(uint64_t off) {
|
||||
@@ -550,8 +545,6 @@ uint64_t raw_fd_ostream::seek(uint64_t off) {
|
||||
flush();
|
||||
#ifdef _WIN32
|
||||
pos = ::_lseeki64(FD, off, SEEK_SET);
|
||||
@@ -180,7 +185,7 @@ index 6b9e5f9e44bd..6fa250a68ed8 100644
|
||||
pos = ::lseek(FD, off, SEEK_SET);
|
||||
#endif
|
||||
diff --git a/llvm/unittests/ADT/SmallStringTest.cpp b/llvm/unittests/ADT/SmallStringTest.cpp
|
||||
index bee3875d11c9..87600ea4704b 100644
|
||||
index bee3875d1..87600ea47 100644
|
||||
--- a/llvm/unittests/ADT/SmallStringTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallStringTest.cpp
|
||||
@@ -129,23 +129,6 @@ TEST_F(SmallStringTest, StdStringConversion) {
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 333f987aa17d7138af8bf6e41d5749041793a721 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Mon, 9 May 2022 00:18:29 -0400
|
||||
Subject: [PATCH 23/27] Add convienence feature to SmallString
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallString.h | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
|
||||
index 85987811f3c4..d3d469d45d15 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallString.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallString.h
|
||||
@@ -188,9 +188,11 @@ public:
|
||||
/// Implicit conversion to std::string_view.
|
||||
operator std::string_view() const { return str(); }
|
||||
|
||||
- explicit operator std::string() const {
|
||||
- return std::string(this->data(), this->size());
|
||||
- }
|
||||
+ /// Explicit conversion to std::string.
|
||||
+ std::string string() const { return {this->begin(), this->size()}; }
|
||||
+
|
||||
+ /// Implicit conversion to std::string.
|
||||
+ operator std::string() const { return string(); }
|
||||
|
||||
// Extra operators.
|
||||
SmallString &operator=(std::string_view RHS) {
|
||||
@@ -1,14 +1,14 @@
|
||||
From 9d6e5efbd4b77747387b35a45d0c591126f7c08c Mon Sep 17 00:00:00 2001
|
||||
From ae08bb29b4d2a8ea15a4b82b909c0f4aee5e9060 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 19:30:43 -0400
|
||||
Subject: [PATCH 24/27] OS specific changes
|
||||
Subject: [PATCH 23/28] OS-specific changes
|
||||
|
||||
---
|
||||
llvm/lib/Support/ErrorHandling.cpp | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 77c3a37475d0..f70f15f27da4 100644
|
||||
index bc08199a1..839819094 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -96,12 +96,7 @@ void llvm::report_fatal_error(std::string_view Reason, bool GenCrashDiag) {
|
||||
@@ -1,7 +1,7 @@
|
||||
From fa16120af5f965c13bd7b75a2e591cd250fad5fa Mon Sep 17 00:00:00 2001
|
||||
From f58b9bad86f61c35cc530ff113ccbb13415261c8 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Mon, 9 May 2022 00:04:30 -0400
|
||||
Subject: [PATCH 25/27] Use smallvector for UTF conversion
|
||||
Subject: [PATCH 24/28] Use SmallVector for UTF conversion
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/ConvertUTF.h | 6 +++---
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH 25/27] Use smallvector for UTF conversion
|
||||
3 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
|
||||
index b085c8a179e8..c82947006afb 100644
|
||||
index b085c8a17..c82947006 100644
|
||||
--- a/llvm/include/llvm/Support/ConvertUTF.h
|
||||
+++ b/llvm/include/llvm/Support/ConvertUTF.h
|
||||
@@ -213,7 +213,7 @@ bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
|
||||
@@ -41,7 +41,7 @@ index b085c8a179e8..c82947006afb 100644
|
||||
/**
|
||||
* Converts a UTF-8 string into a UTF-16 string with native endianness.
|
||||
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
index 87da616b75d4..c6c52d25adb1 100644
|
||||
index cff30f16c..d3689d92a 100644
|
||||
--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
@@ -84,7 +84,7 @@ bool hasUTF16ByteOrderMark(span<const char> S) {
|
||||
@@ -72,7 +72,7 @@ index 87da616b75d4..c6c52d25adb1 100644
|
||||
const UTF8 *Start = reinterpret_cast<const UTF8 *>(Source.data());
|
||||
const UTF8 *End =
|
||||
diff --git a/llvm/unittests/Support/ConvertUTFTest.cpp b/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
index 2fee8ad5c..7d7650b1c 100644
|
||||
--- a/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
+++ b/llvm/unittests/Support/ConvertUTFTest.cpp
|
||||
@@ -19,22 +19,22 @@ TEST(ConvertUTFTest, ConvertUTF16LittleEndianToUTF8String) {
|
||||
@@ -85,7 +85,7 @@ index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
EXPECT_TRUE(Success);
|
||||
std::string Expected("\xe0\xb2\xa0_\xe0\xb2\xa0");
|
||||
- EXPECT_EQ(Expected, Result);
|
||||
+ EXPECT_EQ(Expected, Result.string());
|
||||
+ EXPECT_EQ(Expected, std::string{Result});
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, ConvertUTF16BigEndianToUTF8String) {
|
||||
@@ -98,7 +98,7 @@ index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
EXPECT_TRUE(Success);
|
||||
std::string Expected("\xe0\xb2\xa0_\xe0\xb2\xa0");
|
||||
- EXPECT_EQ(Expected, Result);
|
||||
+ EXPECT_EQ(Expected, Result.string());
|
||||
+ EXPECT_EQ(Expected, std::string{Result});
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, ConvertUTF8ToUTF16String) {
|
||||
@@ -118,7 +118,7 @@ index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
bool Success = convertUTF16ToUTF8String(span<const char>(), Result);
|
||||
EXPECT_TRUE(Success);
|
||||
- EXPECT_TRUE(Result.empty());
|
||||
+ EXPECT_TRUE(Result.string().empty());
|
||||
+ EXPECT_TRUE(std::string{Result}.empty());
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, HasUTF16BOM) {
|
||||
@@ -132,7 +132,7 @@ index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
EXPECT_TRUE(Success);
|
||||
std::string Expected("\xe0\xb2\xa0_\xe0\xb2\xa0");
|
||||
- EXPECT_EQ(Expected, Result);
|
||||
+ EXPECT_EQ(Expected, Result.string());
|
||||
+ EXPECT_EQ(Expected, std::string{Result});
|
||||
}
|
||||
|
||||
TEST(ConvertUTFTest, ConvertUTF8toWide) {
|
||||
@@ -146,7 +146,7 @@ index 2fee8ad5c012..bbdc041cf1d1 100644
|
||||
EXPECT_TRUE(Success);
|
||||
std::string Expected("\xe0\xb2\xa0_\xe0\xb2\xa0");
|
||||
- EXPECT_EQ(Expected, Result);
|
||||
+ EXPECT_EQ(Expected, Result.string());
|
||||
+ EXPECT_EQ(Expected, std::string{Result});
|
||||
}
|
||||
|
||||
struct ConvertUTFResultContainer {
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7bdbcabd3271aebb692ef06a950d1ec59341ddf9 Mon Sep 17 00:00:00 2001
|
||||
From 35b1a8382240732065790c88a0c515701c1a2beb 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 26/27] Prefer to use static pointers in raw_ostream
|
||||
Subject: [PATCH 25/28] Prefer to use static pointers in raw_ostream
|
||||
|
||||
See #1401
|
||||
---
|
||||
@@ -9,10 +9,10 @@ See #1401
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 6fa250a68ed8..6be6809ad951 100644
|
||||
index 632b52235..a703a75ed 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -601,15 +601,15 @@ void raw_fd_ostream::anchor() {}
|
||||
@@ -599,15 +599,15 @@ void raw_fd_ostream::anchor() {}
|
||||
raw_fd_ostream &llvm::outs() {
|
||||
// Set buffer settings to model stdout behavior.
|
||||
std::error_code EC;
|
||||
@@ -1,14 +1,14 @@
|
||||
From 34652f999acd319bb507ca4d504050ec90981e18 Mon Sep 17 00:00:00 2001
|
||||
From 34f44d312c918b3b5dd69fc689ec0b628dc712f9 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Thu, 19 May 2022 01:12:41 -0400
|
||||
Subject: [PATCH 27/27] constexpr endian byte swap
|
||||
Subject: [PATCH 26/28] constexpr endian byte swap
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/Endian.h | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h
|
||||
index 5e7c1e961b9d..2e883ff05b7e 100644
|
||||
index 5e7c1e961..2e883ff05 100644
|
||||
--- a/llvm/include/llvm/Support/Endian.h
|
||||
+++ b/llvm/include/llvm/Support/Endian.h
|
||||
@@ -55,7 +55,9 @@ inline value_type byte_swap(value_type value, endianness endian) {
|
||||
@@ -0,0 +1,69 @@
|
||||
From 8f51777a3117a7b010a4cfb2ded1f5d226466f34 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Veness <calcmogul@gmail.com>
|
||||
Date: Wed, 10 Aug 2022 17:07:52 -0700
|
||||
Subject: [PATCH 27/28] Copy type traits from STLExtras.h into PointerUnion.h
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/PointerUnion.h | 46 ++++++++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h
|
||||
index 1d4cc747c..7d090da59 100644
|
||||
--- a/llvm/include/llvm/ADT/PointerUnion.h
|
||||
+++ b/llvm/include/llvm/ADT/PointerUnion.h
|
||||
@@ -22,9 +22,55 @@
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
+#include <type_traits>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
+namespace detail {
|
||||
+template <typename T, typename... Us> struct TypesAreDistinct;
|
||||
+template <typename T, typename... Us>
|
||||
+struct TypesAreDistinct
|
||||
+ : std::integral_constant<bool, !std::disjunction_v<std::is_same<T, Us>...> &&
|
||||
+ TypesAreDistinct<Us...>::value> {};
|
||||
+template <typename T> struct TypesAreDistinct<T> : std::true_type {};
|
||||
+} // namespace detail
|
||||
+
|
||||
+/// Determine if all types in Ts are distinct.
|
||||
+///
|
||||
+/// Useful to statically assert when Ts is intended to describe a non-multi set
|
||||
+/// of types.
|
||||
+///
|
||||
+/// Expensive (currently quadratic in sizeof(Ts...)), and so should only be
|
||||
+/// asserted once per instantiation of a type which requires it.
|
||||
+template <typename... Ts> struct TypesAreDistinct;
|
||||
+template <> struct TypesAreDistinct<> : std::true_type {};
|
||||
+template <typename... Ts>
|
||||
+struct TypesAreDistinct
|
||||
+ : std::integral_constant<bool, detail::TypesAreDistinct<Ts...>::value> {};
|
||||
+
|
||||
+/// Find the first index where a type appears in a list of types.
|
||||
+///
|
||||
+/// FirstIndexOfType<T, Us...>::value is the first index of T in Us.
|
||||
+///
|
||||
+/// Typically only meaningful when it is otherwise statically known that the
|
||||
+/// type pack has no duplicate types. This should be guaranteed explicitly with
|
||||
+/// static_assert(TypesAreDistinct<Us...>::value).
|
||||
+///
|
||||
+/// It is a compile-time error to instantiate when T is not present in Us, i.e.
|
||||
+/// if is_one_of<T, Us...>::value is false.
|
||||
+template <typename T, typename... Us> struct FirstIndexOfType;
|
||||
+template <typename T, typename U, typename... Us>
|
||||
+struct FirstIndexOfType<T, U, Us...>
|
||||
+ : std::integral_constant<size_t, 1 + FirstIndexOfType<T, Us...>::value> {};
|
||||
+template <typename T, typename... Us>
|
||||
+struct FirstIndexOfType<T, T, Us...> : std::integral_constant<size_t, 0> {};
|
||||
+
|
||||
+/// Find the type at a given index in a list of types.
|
||||
+///
|
||||
+/// TypeAtIndex<I, Ts...> is the type at index I in Ts.
|
||||
+template <size_t I, typename... Ts>
|
||||
+using TypeAtIndex = std::tuple_element_t<I, std::tuple<Ts...>>;
|
||||
+
|
||||
namespace pointer_union_detail {
|
||||
/// Determine the number of bits required to store integers with values < n.
|
||||
/// This is ceil(log2(n)).
|
||||
@@ -0,0 +1,34 @@
|
||||
From 498e56e09e8f264978831519ff9c8afa701bf208 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Veness <calcmogul@gmail.com>
|
||||
Date: Wed, 10 Aug 2022 22:35:00 -0700
|
||||
Subject: [PATCH 28/28] Remove StringMap test for llvm::sort()
|
||||
|
||||
---
|
||||
llvm/unittests/ADT/StringMapTest.cpp | 14 --------------
|
||||
1 file changed, 14 deletions(-)
|
||||
|
||||
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
index de6daf3da..ca41631cc 100644
|
||||
--- a/llvm/unittests/ADT/StringMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/StringMapTest.cpp
|
||||
@@ -308,20 +308,6 @@ TEST_F(StringMapTest, InsertOrAssignTest) {
|
||||
EXPECT_EQ(0, try1.first->second.copy);
|
||||
}
|
||||
|
||||
-TEST_F(StringMapTest, IterMapKeysVector) {
|
||||
- StringMap<int> Map;
|
||||
- Map["A"] = 1;
|
||||
- Map["B"] = 2;
|
||||
- Map["C"] = 3;
|
||||
- Map["D"] = 3;
|
||||
-
|
||||
- std::vector<std::string_view> Keys{Map.keys().begin(), Map.keys().end()};
|
||||
- llvm::sort(Keys);
|
||||
-
|
||||
- std::vector<std::string_view> Expected{{"A", "B", "C", "D"}};
|
||||
- EXPECT_EQ(Expected, Keys);
|
||||
-}
|
||||
-
|
||||
TEST_F(StringMapTest, IterMapKeysSmallVector) {
|
||||
StringMap<int> Map;
|
||||
Map["A"] = 1;
|
||||
@@ -155,7 +155,7 @@ def overwrite_tests(wpiutil_root, llvm_root):
|
||||
|
||||
def main():
|
||||
root, repo = setup_upstream_repo(
|
||||
"https://github.com/llvm/llvm-project", "llvmorg-13.0.0"
|
||||
"https://github.com/llvm/llvm-project", "llvmorg-14.0.6"
|
||||
)
|
||||
wpiutil = os.path.join(root, "wpiutil")
|
||||
|
||||
@@ -164,31 +164,32 @@ def main():
|
||||
frontend_patches = [
|
||||
os.path.join(patch_root, "0001-Fix-spelling-language-errors.patch"),
|
||||
os.path.join(patch_root, "0002-Remove-StringRef-ArrayRef-and-Optional.patch"),
|
||||
os.path.join(patch_root, "0003-Wrap-std-min-max-calls-in-parens-for-windows-warning.patch"),
|
||||
os.path.join(patch_root, "0004-Change-uniqe_function-storage-size.patch"),
|
||||
os.path.join(patch_root, "0003-Wrap-std-min-max-calls-in-parens-for-Windows-warning.patch"),
|
||||
os.path.join(patch_root, "0004-Change-unique_function-storage-size.patch"),
|
||||
os.path.join(patch_root, "0005-Threading-updates.patch"),
|
||||
os.path.join(patch_root, "0006-ifdef-guard-safety.patch"),
|
||||
os.path.join(patch_root, "0007-Explicitly-use-std.patch"),
|
||||
os.path.join(patch_root, "0008-Remove-format_provider.patch"),
|
||||
os.path.join(patch_root, "0009-Add-compiler-warning-pragrams.patch"),
|
||||
os.path.join(patch_root, "0009-Add-compiler-warning-pragmas.patch"),
|
||||
os.path.join(patch_root, "0010-Remove-unused-functions.patch"),
|
||||
os.path.join(patch_root, "0011-Detemplatize-small-vector-base.patch"),
|
||||
os.path.join(patch_root, "0011-Detemplatize-SmallVectorBase.patch"),
|
||||
os.path.join(patch_root, "0012-Add-vectors-to-raw_ostream.patch"),
|
||||
os.path.join(patch_root, "0013-Extra-collections-features.patch"),
|
||||
os.path.join(patch_root, "0014-EpochTracker-abi-macro.patch"),
|
||||
os.path.join(patch_root, "0015-Delete-numbers-from-mathextras.patch"),
|
||||
os.path.join(patch_root, "0014-EpochTracker-ABI-macro.patch"),
|
||||
os.path.join(patch_root, "0015-Delete-numbers-from-MathExtras.patch"),
|
||||
os.path.join(patch_root, "0016-Add-lerp-and-sgn.patch"),
|
||||
os.path.join(patch_root, "0017-Fixup-includes.patch"),
|
||||
os.path.join(patch_root, "0018-use-std-is_trivially_copy_constructible.patch"),
|
||||
os.path.join(patch_root, "0019-Windows-Support.patch"),
|
||||
os.path.join(patch_root, "0018-Use-std-is_trivially_copy_constructible.patch"),
|
||||
os.path.join(patch_root, "0019-Windows-support.patch"),
|
||||
os.path.join(patch_root, "0020-Prefer-fmtlib.patch"),
|
||||
os.path.join(patch_root, "0021-prefer-wpi-s-fs.h.patch"),
|
||||
os.path.join(patch_root, "0021-Prefer-wpi-s-fs.h.patch"),
|
||||
os.path.join(patch_root, "0022-Remove-unused-functions.patch"),
|
||||
os.path.join(patch_root, "0023-Add-convienence-feature-to-SmallString.patch"),
|
||||
os.path.join(patch_root, "0024-OS-specific-changes.patch"),
|
||||
os.path.join(patch_root, "0025-Use-smallvector-for-UTF-conversion.patch"),
|
||||
os.path.join(patch_root, "0026-Prefer-to-use-static-pointers-in-raw_ostream.patch"),
|
||||
os.path.join(patch_root, "0027-constexpr-endian-byte-swap.patch"),
|
||||
os.path.join(patch_root, "0023-OS-specific-changes.patch"),
|
||||
os.path.join(patch_root, "0024-Use-SmallVector-for-UTF-conversion.patch"),
|
||||
os.path.join(patch_root, "0025-Prefer-to-use-static-pointers-in-raw_ostream.patch"),
|
||||
os.path.join(patch_root, "0026-constexpr-endian-byte-swap.patch"),
|
||||
os.path.join(patch_root, "0027-Copy-type-traits-from-STLExtras.h-into-PointerUnion..patch"),
|
||||
os.path.join(patch_root, "0028-Remove-StringMap-test-for-llvm-sort.patch"),
|
||||
|
||||
]
|
||||
# yapf: enable
|
||||
|
||||
Reference in New Issue
Block a user