Skip to content

Commit ae27ab1

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents f405cd5 + 7e2707a commit ae27ab1

File tree

184 files changed

+4137
-2157
lines changed

Some content is hidden

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

184 files changed

+4137
-2157
lines changed

bolt/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,11 @@ endif()
202202

203203
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in
204204
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc @ONLY)
205+
206+
set(BOLT_ENUM_TARGETS "")
207+
foreach(t ${BOLT_TARGETS_TO_BUILD})
208+
set(BOLT_ENUM_TARGETS "${BOLT_ENUM_TARGETS}BOLT_TARGET(${t})\n")
209+
endforeach(t)
210+
211+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/Core/TargetConfig.def.in
212+
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/Core/TargetConfig.def @ONLY)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- TargetConfig.def.in - Information about available targets ---------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file is configured by the build system to define the available bolt
10+
// targets.
11+
//
12+
// The variant of this file not ending with .in has been autogenerated by the
13+
// LLVM build. Do not edit!
14+
//
15+
//===----------------------------------------------------------------------===//
16+
17+
#ifndef BOLT_TARGET
18+
# error Please define the macro BOLT_TARGET(TargetName)
19+
#endif
20+
21+
@BOLT_ENUM_TARGETS@
22+
23+
#undef BOLT_TARGET

bolt/tools/binary-analysis/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/binary-analysis/binary-analysis.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ int main(int argc, char **argv) {
8888
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
8989

9090
// Initialize targets and assembly printers/parsers.
91-
llvm::InitializeAllTargetInfos();
92-
llvm::InitializeAllTargetMCs();
93-
llvm::InitializeAllAsmParsers();
94-
llvm::InitializeAllDisassemblers();
95-
96-
llvm::InitializeAllTargets();
97-
llvm::InitializeAllAsmPrinters();
91+
#define BOLT_TARGET(target) \
92+
LLVMInitialize##target##TargetInfo(); \
93+
LLVMInitialize##target##TargetMC(); \
94+
LLVMInitialize##target##AsmParser(); \
95+
LLVMInitialize##target##Disassembler(); \
96+
LLVMInitialize##target##Target(); \
97+
LLVMInitialize##target##AsmPrinter();
98+
99+
#include "bolt/Core/TargetConfig.def"
98100

99101
ParseCommandLine(argc, argv);
100102

bolt/tools/driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,15 @@ int main(int argc, char **argv) {
183183
std::string ToolPath = llvm::sys::fs::getMainExecutable(argv[0], nullptr);
184184

185185
// Initialize targets and assembly printers/parsers.
186-
llvm::InitializeAllTargetInfos();
187-
llvm::InitializeAllTargetMCs();
188-
llvm::InitializeAllAsmParsers();
189-
llvm::InitializeAllDisassemblers();
190-
191-
llvm::InitializeAllTargets();
192-
llvm::InitializeAllAsmPrinters();
186+
#define BOLT_TARGET(target) \
187+
LLVMInitialize##target##TargetInfo(); \
188+
LLVMInitialize##target##TargetMC(); \
189+
LLVMInitialize##target##AsmParser(); \
190+
LLVMInitialize##target##Disassembler(); \
191+
LLVMInitialize##target##Target(); \
192+
LLVMInitialize##target##AsmPrinter();
193+
194+
#include "bolt/Core/TargetConfig.def"
193195

194196
ToolName = argv[0];
195197

bolt/tools/heatmap/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/heatmap/heatmap.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ int main(int argc, char **argv) {
7676
opts::OutputFilename = "-";
7777

7878
// Initialize targets and assembly printers/parsers.
79-
llvm::InitializeAllTargetInfos();
80-
llvm::InitializeAllTargetMCs();
81-
llvm::InitializeAllAsmParsers();
82-
llvm::InitializeAllDisassemblers();
83-
84-
llvm::InitializeAllTargets();
85-
llvm::InitializeAllAsmPrinters();
79+
#define BOLT_TARGET(target) \
80+
LLVMInitialize##target##TargetInfo(); \
81+
LLVMInitialize##target##TargetMC(); \
82+
LLVMInitialize##target##AsmParser(); \
83+
LLVMInitialize##target##Disassembler(); \
84+
LLVMInitialize##target##Target(); \
85+
LLVMInitialize##target##AsmPrinter();
86+
87+
#include "bolt/Core/TargetConfig.def"
8688

8789
ToolName = argv[0];
8890
std::string ToolPath = GetExecutablePath(argv[0]);

bolt/tools/llvm-bolt-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
)
44

55
add_llvm_fuzzer(llvm-bolt-fuzzer

bolt/tools/llvm-bolt-fuzzer/llvm-bolt-fuzzer.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,16 @@ extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
5858

5959
extern "C" LLVM_ATTRIBUTE_USED int LLVMFuzzerInitialize(int *argc,
6060
char ***argv) {
61-
llvm::InitializeAllTargetInfos();
62-
llvm::InitializeAllTargetMCs();
63-
llvm::InitializeAllAsmParsers();
64-
llvm::InitializeAllDisassemblers();
61+
// Initialize targets and assembly printers/parsers.
62+
#define BOLT_TARGET(target) \
63+
LLVMInitialize##target##TargetInfo(); \
64+
LLVMInitialize##target##TargetMC(); \
65+
LLVMInitialize##target##AsmParser(); \
66+
LLVMInitialize##target##Disassembler(); \
67+
LLVMInitialize##target##Target(); \
68+
LLVMInitialize##target##AsmPrinter();
6569

66-
llvm::InitializeAllTargets();
67-
llvm::InitializeAllAsmPrinters();
70+
#include "bolt/Core/TargetConfig.def"
6871

6972
return 0;
7073
}

bolt/unittests/Core/BinaryContext.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ struct BinaryContextTester : public testing::TestWithParam<Triple::ArchType> {
2727

2828
protected:
2929
void initalizeLLVM() {
30-
llvm::InitializeAllTargetInfos();
31-
llvm::InitializeAllTargetMCs();
32-
llvm::InitializeAllAsmParsers();
33-
llvm::InitializeAllDisassemblers();
34-
llvm::InitializeAllTargets();
35-
llvm::InitializeAllAsmPrinters();
30+
#define BOLT_TARGET(target) \
31+
LLVMInitialize##target##TargetInfo(); \
32+
LLVMInitialize##target##TargetMC(); \
33+
LLVMInitialize##target##AsmParser(); \
34+
LLVMInitialize##target##Disassembler(); \
35+
LLVMInitialize##target##Target(); \
36+
LLVMInitialize##target##AsmPrinter();
37+
38+
#include "bolt/Core/TargetConfig.def"
3639
}
3740

3841
void prepareElf() {

bolt/unittests/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set(LLVM_LINK_COMPONENTS
22
DebugInfoDWARF
33
Object
44
MC
5-
${LLVM_TARGETS_TO_BUILD}
5+
${BOLT_TARGETS_TO_BUILD}
66
)
77

88
add_bolt_unittest(CoreTests

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ struct MCPlusBuilderTester : public testing::TestWithParam<Triple::ArchType> {
3737

3838
protected:
3939
void initalizeLLVM() {
40-
llvm::InitializeAllTargetInfos();
41-
llvm::InitializeAllTargetMCs();
42-
llvm::InitializeAllAsmParsers();
43-
llvm::InitializeAllDisassemblers();
44-
llvm::InitializeAllTargets();
45-
llvm::InitializeAllAsmPrinters();
40+
#define BOLT_TARGET(target) \
41+
LLVMInitialize##target##TargetInfo(); \
42+
LLVMInitialize##target##TargetMC(); \
43+
LLVMInitialize##target##AsmParser(); \
44+
LLVMInitialize##target##Disassembler(); \
45+
LLVMInitialize##target##Target(); \
46+
LLVMInitialize##target##AsmPrinter();
47+
48+
#include "bolt/Core/TargetConfig.def"
4649
}
4750

4851
void prepareElf() {

bolt/unittests/Core/MemoryMaps.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ struct MemoryMapsTester : public testing::TestWithParam<Triple::ArchType> {
3838

3939
protected:
4040
void initalizeLLVM() {
41-
llvm::InitializeAllTargetInfos();
42-
llvm::InitializeAllTargetMCs();
43-
llvm::InitializeAllAsmParsers();
44-
llvm::InitializeAllDisassemblers();
45-
llvm::InitializeAllTargets();
46-
llvm::InitializeAllAsmPrinters();
41+
#define BOLT_TARGET(target) \
42+
LLVMInitialize##target##TargetInfo(); \
43+
LLVMInitialize##target##TargetMC(); \
44+
LLVMInitialize##target##AsmParser(); \
45+
LLVMInitialize##target##Disassembler(); \
46+
LLVMInitialize##target##Target(); \
47+
LLVMInitialize##target##AsmPrinter();
48+
49+
#include "bolt/Core/TargetConfig.def"
4750
}
4851

4952
void prepareElf() {

clang-tools-extra/clangd/ClangdServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class ClangdServer {
184184
bool UseDirtyHeaders = false;
185185

186186
// If true, parse emplace-like functions in the preamble.
187-
bool PreambleParseForwardingFunctions = false;
187+
bool PreambleParseForwardingFunctions = true;
188188

189189
/// Whether include fixer insertions for Objective-C code should use #import
190190
/// instead of #include.
@@ -501,7 +501,7 @@ class ClangdServer {
501501
// Whether the client supports folding only complete lines.
502502
bool LineFoldingOnly = false;
503503

504-
bool PreambleParseForwardingFunctions = false;
504+
bool PreambleParseForwardingFunctions = true;
505505

506506
bool ImportInsertions = false;
507507

clang-tools-extra/clangd/Compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class IgnoreDiagnostics : public DiagnosticConsumer {
4040

4141
// Options to run clang e.g. when parsing AST.
4242
struct ParseOptions {
43-
bool PreambleParseForwardingFunctions = false;
43+
bool PreambleParseForwardingFunctions = true;
4444

4545
bool ImportInsertions = false;
4646
};

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Bug Fixes to C++ Support
173173

174174
Bug Fixes to AST Handling
175175
^^^^^^^^^^^^^^^^^^^^^^^^^
176+
- Fixed type checking when a statement expression ends in an l-value of atomic type. (#GH106576)
176177

177178
Miscellaneous Bug Fixes
178179
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclCXX.h

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4194,8 +4194,8 @@ class BindingDecl : public ValueDecl {
41944194
/// decomposition declaration, and when the initializer is type-dependent.
41954195
Expr *getBinding() const { return Binding; }
41964196

4197-
// Get the array of Exprs when the binding represents a pack.
4198-
llvm::ArrayRef<Expr *> getBindingPackExprs() const;
4197+
// Get the array of nested BindingDecls when the binding represents a pack.
4198+
llvm::ArrayRef<BindingDecl *> getBindingPackDecls() const;
41994199

42004200
/// Get the decomposition declaration that this binding represents a
42014201
/// decomposition of.
@@ -4246,10 +4246,8 @@ class DecompositionDecl final
42464246
for (auto *B : Bindings) {
42474247
B->setDecomposedDecl(this);
42484248
if (B->isParameterPack() && B->getBinding()) {
4249-
for (Expr *E : B->getBindingPackExprs()) {
4250-
auto *DRE = cast<DeclRefExpr>(E);
4251-
auto *NestedB = cast<BindingDecl>(DRE->getDecl());
4252-
NestedB->setDecomposedDecl(this);
4249+
for (BindingDecl *NestedBD : B->getBindingPackDecls()) {
4250+
NestedBD->setDecomposedDecl(this);
42534251
}
42544252
}
42554253
}
@@ -4278,25 +4276,21 @@ class DecompositionDecl final
42784276
// Provide a flattened range to visit each binding.
42794277
auto flat_bindings() const {
42804278
llvm::ArrayRef<BindingDecl *> Bindings = bindings();
4281-
llvm::ArrayRef<Expr *> PackExprs;
4279+
llvm::ArrayRef<BindingDecl *> PackBindings;
42824280

42834281
// Split the bindings into subranges split by the pack.
4284-
auto S1 = Bindings.take_until(
4282+
llvm::ArrayRef<BindingDecl *> BeforePackBindings = Bindings.take_until(
42854283
[](BindingDecl *BD) { return BD->isParameterPack(); });
42864284

4287-
Bindings = Bindings.drop_front(S1.size());
4285+
Bindings = Bindings.drop_front(BeforePackBindings.size());
42884286
if (!Bindings.empty()) {
4289-
PackExprs = Bindings.front()->getBindingPackExprs();
4287+
PackBindings = Bindings.front()->getBindingPackDecls();
42904288
Bindings = Bindings.drop_front();
42914289
}
42924290

4293-
auto S2 = llvm::map_range(PackExprs, [](Expr *E) {
4294-
auto *DRE = cast<DeclRefExpr>(E);
4295-
return cast<BindingDecl>(DRE->getDecl());
4296-
});
4297-
4298-
return llvm::concat<BindingDecl *>(std::move(S1), std::move(S2),
4299-
std::move(Bindings));
4291+
return llvm::concat<BindingDecl *const>(std::move(BeforePackBindings),
4292+
std::move(PackBindings),
4293+
std::move(Bindings));
43004294
}
43014295

43024296
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override;

0 commit comments

Comments
 (0)