Skip to content

Commit ee56147

Browse files
iclsrcjsji
authored andcommitted
Merge from 'main' to 'sycl-web' (102 commits)
2 parents c9fd294 + b86ddae commit ee56147

File tree

478 files changed

+25400
-16747
lines changed

Some content is hidden

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

478 files changed

+25400
-16747
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

bolt/include/bolt/Rewrite/RewriteInstance.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,11 @@ class RewriteInstance {
249249
/// Analyze relocation \p Rel.
250250
/// Return true if the relocation was successfully processed, false otherwise.
251251
/// The \p SymbolName, \p SymbolAddress, \p Addend and \p ExtractedValue
252-
/// parameters will be set on success. The \p Skip argument indicates
253-
/// that the relocation was analyzed, but it must not be processed.
252+
/// parameters will be set on success.
254253
bool analyzeRelocation(const object::RelocationRef &Rel, uint32_t &RType,
255254
std::string &SymbolName, bool &IsSectionRelocation,
256255
uint64_t &SymbolAddress, int64_t &Addend,
257-
uint64_t &ExtractedValue, bool &Skip) const;
256+
uint64_t &ExtractedValue) const;
258257

259258
/// Rewrite non-allocatable sections with modifications.
260259
void rewriteNoteSections();

bolt/lib/Core/Relocation.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static bool isSupportedAArch64(uint32_t Type) {
8181
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
8282
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
8383
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
84-
case ELF::R_AARCH64_TLSDESC_CALL:
8584
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
8685
case ELF::R_AARCH64_PREL16:
8786
case ELF::R_AARCH64_PREL32:
@@ -193,7 +192,6 @@ static size_t getSizeForTypeAArch64(uint32_t Type) {
193192
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
194193
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
195194
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
196-
case ELF::R_AARCH64_TLSDESC_CALL:
197195
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
198196
case ELF::R_AARCH64_PREL32:
199197
case ELF::R_AARCH64_MOVW_UABS_G0:
@@ -248,7 +246,14 @@ static bool skipRelocationTypeX86(uint32_t Type) {
248246
}
249247

250248
static bool skipRelocationTypeAArch64(uint32_t Type) {
251-
return Type == ELF::R_AARCH64_NONE || Type == ELF::R_AARCH64_LD_PREL_LO19;
249+
switch (Type) {
250+
default:
251+
return false;
252+
case ELF::R_AARCH64_NONE:
253+
case ELF::R_AARCH64_LD_PREL_LO19:
254+
case ELF::R_AARCH64_TLSDESC_CALL:
255+
return true;
256+
}
252257
}
253258

254259
static bool skipRelocationTypeRISCV(uint32_t Type) {
@@ -362,7 +367,6 @@ static uint64_t extractValueAArch64(uint32_t Type, uint64_t Contents,
362367
return static_cast<int64_t>(PC) + SignExtend64<32>(Contents & 0xffffffff);
363368
case ELF::R_AARCH64_PREL64:
364369
return static_cast<int64_t>(PC) + Contents;
365-
case ELF::R_AARCH64_TLSDESC_CALL:
366370
case ELF::R_AARCH64_JUMP26:
367371
case ELF::R_AARCH64_CALL26:
368372
// Immediate goes in bits 25:0 of B and BL.
@@ -552,7 +556,6 @@ static bool isGOTAArch64(uint32_t Type) {
552556
case ELF::R_AARCH64_TLSDESC_ADR_PAGE21:
553557
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
554558
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
555-
case ELF::R_AARCH64_TLSDESC_CALL:
556559
return true;
557560
}
558561
}
@@ -591,7 +594,6 @@ static bool isTLSAArch64(uint32_t Type) {
591594
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
592595
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
593596
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
594-
case ELF::R_AARCH64_TLSDESC_CALL:
595597
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
596598
return true;
597599
}
@@ -667,7 +669,6 @@ static bool isPCRelativeAArch64(uint32_t Type) {
667669
case ELF::R_AARCH64_MOVW_UABS_G2_NC:
668670
case ELF::R_AARCH64_MOVW_UABS_G3:
669671
return false;
670-
case ELF::R_AARCH64_TLSDESC_CALL:
671672
case ELF::R_AARCH64_CALL26:
672673
case ELF::R_AARCH64_JUMP26:
673674
case ELF::R_AARCH64_TSTBR14:

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,8 +2274,7 @@ uint32_t getRelocationSymbol(const ELFObjectFileBase *Obj,
22742274
bool RewriteInstance::analyzeRelocation(
22752275
const RelocationRef &Rel, uint32_t &RType, std::string &SymbolName,
22762276
bool &IsSectionRelocation, uint64_t &SymbolAddress, int64_t &Addend,
2277-
uint64_t &ExtractedValue, bool &Skip) const {
2278-
Skip = false;
2277+
uint64_t &ExtractedValue) const {
22792278
if (!Relocation::isSupported(RType))
22802279
return false;
22812280

@@ -2707,9 +2706,8 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
27072706
int64_t Addend;
27082707
uint64_t ExtractedValue;
27092708
bool IsSectionRelocation;
2710-
bool Skip;
27112709
if (!analyzeRelocation(Rel, RType, SymbolName, IsSectionRelocation,
2712-
SymbolAddress, Addend, ExtractedValue, Skip)) {
2710+
SymbolAddress, Addend, ExtractedValue)) {
27132711
LLVM_DEBUG({
27142712
dbgs() << "BOLT-WARNING: failed to analyze relocation @ offset = "
27152713
<< formatv("{0:x}; type name = {1}\n", Rel.getOffset(), TypeName);
@@ -2718,14 +2716,6 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
27182716
return;
27192717
}
27202718

2721-
if (Skip) {
2722-
LLVM_DEBUG({
2723-
dbgs() << "BOLT-DEBUG: skipping relocation @ offset = "
2724-
<< formatv("{0:x}; type name = {1}\n", Rel.getOffset(), TypeName);
2725-
});
2726-
return;
2727-
}
2728-
27292719
if (!IsFromCode && !IsWritable && (IsX86 || IsAArch64) &&
27302720
Relocation::isPCRelative(RType)) {
27312721
BinaryData *BD = BC->getBinaryDataContainingAddress(Rel.getOffset());

bolt/test/AArch64/tls-desc-call.s

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# RUN: %clang %cflags %s -o %t.so -fPIC -shared -Wl,-q
2+
# RUN: llvm-bolt %t.so -o %t.bolt --debug-only=bolt 2>&1 | FileCheck %s
3+
4+
# REQUIRES: asserts
5+
6+
## Verify that R_AARCH64_TLSDESC_CALL relocations are ignored
7+
8+
# CHECK-NOT: Relocation {{.*}} R_AARCH64_TLSDESC_CALL
9+
10+
.text
11+
.globl get_tls_var
12+
.p2align 2
13+
.type get_tls_var,@function
14+
get_tls_var:
15+
.cfi_startproc
16+
str x30, [sp, #-16]!
17+
adrp x0, :tlsdesc:tls_var
18+
ldr x1, [x0, :tlsdesc_lo12:tls_var]
19+
add x0, x0, :tlsdesc_lo12:tls_var
20+
.tlsdesccall tls_var
21+
blr x1
22+
mrs x8, TPIDR_EL0
23+
ldr w0, [x8, x0]
24+
ldr x30, [sp], #16
25+
ret
26+
.size get_tls_var, .-get_tls_var
27+
.cfi_endproc
28+
29+
.type tls_var,@object
30+
.section .tdata,"awT",@progbits
31+
.globl tls_var
32+
.p2align 2, 0x0
33+
tls_var:
34+
.word 42
35+
.size tls_var, 4

clang-tools-extra/clang-include-fixer/IncludeFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ bool IncludeFixerActionFactory::runInvocation(
9696
// diagnostics here.
9797
Compiler.createDiagnostics(new clang::IgnoringDiagConsumer,
9898
/*ShouldOwnClient=*/true);
99-
Compiler.createSourceManager(*Files);
99+
Compiler.createSourceManager();
100100

101101
// We abort on fatal errors so don't let a large number of errors become
102102
// fatal. A missing #include can cause thousands of errors.

clang-tools-extra/include-cleaner/unittests/RecordTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,12 @@ TEST_F(PragmaIncludeTest, ExportInUnnamedBuffer) {
649649
Clang->createVirtualFileSystem(VFS);
650650
Clang->createDiagnostics();
651651

652-
auto *FM = Clang->createFileManager();
652+
Clang->createFileManager();
653+
FileManager &FM = Clang->getFileManager();
653654
ASSERT_TRUE(Clang->ExecuteAction(*Inputs.MakeAction()));
654655
EXPECT_THAT(
655-
PI.getExporters(llvm::cantFail(FM->getFileRef("foo.h")), *FM),
656-
testing::ElementsAre(llvm::cantFail(FM->getFileRef("exporter.h"))));
656+
PI.getExporters(llvm::cantFail(FM.getFileRef("foo.h")), FM),
657+
testing::ElementsAre(llvm::cantFail(FM.getFileRef("exporter.h"))));
657658
}
658659

659660
TEST_F(PragmaIncludeTest, OutlivesFMAndSM) {

clang/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ Bug Fixes to C++ Support
437437
- Fix the result of `__builtin_is_implicit_lifetime` for types with a user-provided constructor. (#GH160610)
438438
- Correctly deduce return types in ``decltype`` expressions. (#GH160497) (#GH56652) (#GH116319) (#GH161196)
439439
- Fixed a crash in the pre-C++23 warning for attributes before a lambda declarator (#GH161070).
440+
- Fix a crash when attempting to deduce a deduction guide from a non deducible template template parameter. (#130604)
440441

441442
Bug Fixes to AST Handling
442443
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -445,6 +446,7 @@ Bug Fixes to AST Handling
445446
legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)
446447
- Fix unrecognized html tag causing undesirable comment lexing (#GH152944)
447448
- Fix comment lexing of special command names (#GH152943)
449+
- Use `extern` as a hint to continue parsing when recovering from a malformed declaration.
448450

449451
Miscellaneous Bug Fixes
450452
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/TypeBase.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6712,15 +6712,21 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
67126712
LLVM_PREFERRED_TYPE(bool)
67136713
uint8_t RawBuffer : 1;
67146714

6715+
LLVM_PREFERRED_TYPE(bool)
6716+
uint8_t IsCounter : 1;
6717+
67156718
Attributes(llvm::dxil::ResourceClass ResourceClass, bool IsROV = false,
6716-
bool RawBuffer = false)
6717-
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
6719+
bool RawBuffer = false, bool IsCounter = false)
6720+
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer),
6721+
IsCounter(IsCounter) {}
67186722

6719-
Attributes() : Attributes(llvm::dxil::ResourceClass::UAV, false, false) {}
6723+
Attributes()
6724+
: Attributes(llvm::dxil::ResourceClass::UAV, false, false, false) {}
67206725

67216726
friend bool operator==(const Attributes &LHS, const Attributes &RHS) {
6722-
return std::tie(LHS.ResourceClass, LHS.IsROV, LHS.RawBuffer) ==
6723-
std::tie(RHS.ResourceClass, RHS.IsROV, RHS.RawBuffer);
6727+
return std::tie(LHS.ResourceClass, LHS.IsROV, LHS.RawBuffer,
6728+
LHS.IsCounter) == std::tie(RHS.ResourceClass, RHS.IsROV,
6729+
RHS.RawBuffer, RHS.IsCounter);
67246730
}
67256731
friend bool operator!=(const Attributes &LHS, const Attributes &RHS) {
67266732
return !(LHS == RHS);
@@ -6761,6 +6767,7 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
67616767
ID.AddInteger(static_cast<uint32_t>(Attrs.ResourceClass));
67626768
ID.AddBoolean(Attrs.IsROV);
67636769
ID.AddBoolean(Attrs.RawBuffer);
6770+
ID.AddBoolean(Attrs.IsCounter);
67646771
}
67656772

67666773
static bool classof(const Type *T) {

0 commit comments

Comments
 (0)