Skip to content

Commit 560fe75

Browse files
authored
Merge pull request #77212 from bnbarham/2024-rebranch-to-main
Update LLVM to stable/20240723
2 parents 71e3136 + f59b2f1 commit 560fe75

File tree

227 files changed

+1809
-1570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+1809
-1570
lines changed

include/swift/AST/PluginRegistry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CompilerPlugin {
8787

8888
/// Remove "on reconnect" callback.
8989
void removeOnReconnect(std::function<void(void)> *fn) {
90-
llvm::erase_value(onReconnect, fn);
90+
llvm::erase(onReconnect, fn);
9191
}
9292

9393
ArrayRef<std::function<void(void)> *> getOnReconnectCallbacks() {

include/swift/Basic/ExponentialGrowthAppendingBinaryByteStream.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "swift/Basic/LLVM.h"
2424
#include "llvm/ADT/ArrayRef.h"
2525
#include "llvm/Support/BinaryByteStream.h"
26+
#include "llvm/Support/Endian.h"
2627

2728
namespace swift {
2829

@@ -34,13 +35,14 @@ class ExponentialGrowthAppendingBinaryByteStream
3435
SmallVector<uint8_t, 0> Data;
3536

3637
/// Data in the stream is always encoded in little-endian byte order.
37-
const llvm::support::endianness Endian = llvm::support::endianness::little;
38+
const llvm::endianness Endian = llvm::endianness::little;
39+
3840
public:
3941
ExponentialGrowthAppendingBinaryByteStream() = default;
4042

4143
void reserve(size_t Size);
4244

43-
llvm::support::endianness getEndian() const override { return Endian; }
45+
llvm::endianness getEndian() const override { return Endian; }
4446

4547
llvm::Error readBytes(uint64_t Offset, uint64_t Size,
4648
ArrayRef<uint8_t> &Buffer) override;

include/swift/Basic/StableHasher.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class StableHasher final {
133133
return setBufferLength(bufLen + N);
134134
}
135135

136-
constexpr auto endian = llvm::support::endianness::little;
136+
constexpr auto endian = llvm::endianness::little;
137137
compress(llvm::support::endian::read<uint64_t>(byteBuffer, endian));
138138

139139
// Now reseed the buffer with the remaining bytes.
@@ -146,7 +146,7 @@ class StableHasher final {
146146
typename T,
147147
typename std::enable_if<std::is_integral<T>::value>::type * = nullptr>
148148
void combine(T bits) {
149-
constexpr auto endian = llvm::support::endianness::little;
149+
constexpr auto endian = llvm::endianness::little;
150150
uint8_t buf[sizeof(T)] = {0};
151151
bits = llvm::support::endian::byte_swap<T>(bits, endian);
152152
std::memcpy(buf, &bits, sizeof(T));

include/swift/ClangImporter/ClangModule.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/Basic/Version.h"
2121
#include "swift/ClangImporter/ClangImporter.h"
2222
#include "clang/AST/ExternalASTSource.h"
23+
#include "clang/Basic/ASTSourceDescriptor.h"
2324
#include "clang/Basic/Module.h"
2425

2526
namespace clang {

include/swift/ClangImporter/SwiftAbstractBasicReader.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class DataStreamBasicReader
7272
return clang::Selector();
7373

7474
unsigned numArgs = unsigned(numArgsPlusOne - 1);
75-
SmallVector<clang::IdentifierInfo *, 4> chunks;
75+
SmallVector<const clang::IdentifierInfo *, 4> chunks;
7676
for (unsigned i = 0, e = std::max(numArgs, 1U); i != e; ++i)
7777
chunks.push_back(asImpl().readIdentifier());
7878

@@ -94,6 +94,11 @@ class DataStreamBasicReader
9494
llvm::report_fatal_error("Read BTFTypeTagAttr that should never have been"
9595
" serialized");
9696
}
97+
98+
template<typename T>
99+
T *readDeclAs() {
100+
return asImpl().template readDeclAs<T>();
101+
}
97102
};
98103

99104
}

include/swift/DependencyScan/ModuleDependencyScanner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class ModuleDependencyScanner {
149149
/// The available pool of workers for filesystem module search
150150
unsigned NumThreads;
151151
std::list<std::unique_ptr<ModuleDependencyScanningWorker>> Workers;
152-
llvm::ThreadPool ScanningThreadPool;
152+
llvm::StdThreadPool ScanningThreadPool;
153153
/// Protect worker access.
154154
std::mutex WorkersLock;
155155
};

include/swift/Localization/LocalizationFormat.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ enum class DiagID : uint32_t;
4040

4141
namespace diag {
4242

43-
using namespace llvm::support;
44-
4543
enum LocalizationProducerState : uint8_t {
4644
NotInitialized,
4745
Initialized,
@@ -77,14 +75,15 @@ class LocalizationWriterInfo {
7775
key_type_ref key,
7876
data_type_ref data) {
7977
offset_type dataLength = static_cast<offset_type>(data.size());
80-
endian::write<offset_type>(out, dataLength, little);
78+
llvm::support::endian::write<offset_type>(out, dataLength,
79+
llvm::endianness::little);
8180
// No need to write the key length; it's constant.
8281
return {sizeof(key_type), dataLength};
8382
}
8483

8584
void EmitKey(llvm::raw_ostream &out, key_type_ref key, unsigned len) {
8685
assert(len == sizeof(key_type));
87-
endian::write<key_type>(out, key, little);
86+
llvm::support::endian::write<key_type>(out, key, llvm::endianness::little);
8887
}
8988

9089
void EmitData(llvm::raw_ostream &out, key_type_ref key, data_type_ref data,
@@ -118,12 +117,15 @@ class LocalizationReaderInfo {
118117
static std::pair<offset_type, offset_type>
119118
ReadKeyDataLength(const unsigned char *&data) {
120119
offset_type dataLength =
121-
endian::readNext<offset_type, little, unaligned>(data);
120+
llvm::support::endian::readNext<offset_type, llvm::endianness::little,
121+
llvm::support::unaligned>(data);
122122
return {sizeof(uint32_t), dataLength};
123123
}
124124

125125
internal_key_type ReadKey(const unsigned char *data, offset_type length) {
126-
return endian::readNext<internal_key_type, little, unaligned>(data);
126+
return llvm::support::endian::readNext<
127+
internal_key_type, llvm::endianness::little, llvm::support::unaligned>(
128+
data);
127129
}
128130

129131
data_type ReadData(internal_key_type Key, const unsigned char *data,

include/swift/Option/Options.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
#ifndef SWIFT_OPTION_OPTIONS_H
1414
#define SWIFT_OPTION_OPTIONS_H
1515

16-
#include <memory>
16+
#include "llvm/Option/OptTable.h"
1717

18-
namespace llvm {
19-
namespace opt {
20-
class OptTable;
21-
}
22-
}
18+
#include <memory>
2319

2420
namespace swift {
2521
namespace options {
@@ -47,9 +43,7 @@ namespace options {
4743

4844
enum ID {
4945
OPT_INVALID = 0, // This is not an option ID.
50-
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
51-
HELPTEXT, METAVAR, VALUES) \
52-
OPT_##ID,
46+
#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
5347
#include "swift/Option/Options.inc"
5448
LastOption
5549
#undef OPTION

include/swift/SIL/SILInstruction.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace ilist_detail {
5959
///
6060
/// We need a custom base class to not clear the prev/next pointers when
6161
/// removing an instruction from the list.
62-
class SILInstructionListBase : public ilist_base<false> {
62+
class SILInstructionListBase : public ilist_base<false, void> {
6363
public:
6464
/// Remove an instruction from the list.
6565
///
@@ -95,8 +95,10 @@ template <> struct compute_node_options<::swift::SILInstruction> {
9595

9696
static const bool enable_sentinel_tracking = false;
9797
static const bool is_sentinel_tracking_explicit = false;
98+
static const bool has_iterator_bits = false;
9899
typedef void tag;
99-
typedef ilist_node_base<enable_sentinel_tracking> node_base_type;
100+
typedef void parent_ty;
101+
typedef ilist_node_base<enable_sentinel_tracking, void> node_base_type;
100102
typedef SILInstructionListBase list_base_type;
101103
};
102104
};

lib/AST/ASTMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3075,7 +3075,7 @@ void ASTMangler::appendClangType(FnType *fn, llvm::raw_svector_ostream &out) {
30753075
fn->getASTContext().getClangModuleLoader()->getClangASTContext();
30763076
std::unique_ptr<clang::ItaniumMangleContext> mangler{
30773077
clang::ItaniumMangleContext::create(clangCtx, clangCtx.getDiagnostics())};
3078-
mangler->mangleTypeName(clang::QualType(clangType, 0), scratchOS);
3078+
mangler->mangleCanonicalTypeName(clang::QualType(clangType, 0), scratchOS);
30793079
out << scratchOS.str().size() << scratchOS.str();
30803080
}
30813081

0 commit comments

Comments
 (0)