Skip to content

Commit 658bd48

Browse files
committed
Merge branch 'main' into users/chapuni/cov/binary
Conflicts: llvm/test/tools/llvm-cov/branch-macros.test llvm/test/tools/llvm-cov/showLineExecutionCounts.test
2 parents 822620b + 7ec139a commit 658bd48

File tree

1,468 files changed

+34134
-12484
lines changed

Some content is hidden

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

1,468 files changed

+34134
-12484
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
config: [
46+
'frozen-cxx03-headers',
4647
'generic-cxx03',
4748
'generic-cxx26',
4849
'generic-modules'

bolt/lib/Core/BinaryContext.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,15 @@ void BinaryContext::printInstruction(raw_ostream &OS, const MCInst &Instruction,
19611961
OS << "\tjit\t" << MIB->getTargetSymbol(Instruction)->getName()
19621962
<< " # ID: " << DynamicID;
19631963
} else {
1964-
InstPrinter->printInst(&Instruction, 0, "", *STI, OS);
1964+
// If there are annotations on the instruction, the MCInstPrinter will fail
1965+
// to print the preferred alias as it only does so when the number of
1966+
// operands is as expected. See
1967+
// https://github.com/llvm/llvm-project/blob/782f1a0d895646c364a53f9dcdd6d4ec1f3e5ea0/llvm/lib/MC/MCInstPrinter.cpp#L142
1968+
// Therefore, create a temporary copy of the Inst from which the annotations
1969+
// are removed, and print that Inst.
1970+
MCInst InstNoAnnot = Instruction;
1971+
MIB->stripAnnotations(InstNoAnnot);
1972+
InstPrinter->printInst(&InstNoAnnot, 0, "", *STI, OS);
19651973
}
19661974
if (MIB->isCall(Instruction)) {
19671975
if (MIB->isTailCall(Instruction))

bolt/lib/Core/Relocation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ static bool isSupportedAArch64(uint64_t Type) {
7575
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
7676
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
7777
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
78+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
79+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
7880
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
7981
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
8082
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -183,6 +185,8 @@ static size_t getSizeForTypeAArch64(uint64_t Type) {
183185
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
184186
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
185187
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
188+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
189+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
186190
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
187191
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
188192
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -651,6 +655,8 @@ static bool isTLSAArch64(uint64_t Type) {
651655
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
652656
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
653657
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
658+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
659+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
654660
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
655661
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
656662
case ELF::R_AARCH64_TLSDESC_CALL:
@@ -716,6 +722,8 @@ static bool isPCRelativeAArch64(uint64_t Type) {
716722
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
717723
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
718724
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
725+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
726+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
719727
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
720728
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
721729
case ELF::R_AARCH64_TLSDESC_ADD_LO12:

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
14491449
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
14501450
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
14511451
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
1452+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
1453+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
14521454
case ELF::R_AARCH64_MOVW_UABS_G0:
14531455
case ELF::R_AARCH64_MOVW_UABS_G0_NC:
14541456
case ELF::R_AARCH64_MOVW_UABS_G1:

bolt/test/RISCV/call-annotations.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ f:
1616

1717
// CHECK-LABEL: Binary Function "_start" after building cfg {
1818
// CHECK: auipc ra, f
19-
// CHECK-NEXT: jalr ra, -0x4(ra) # Offset: 4
20-
// CHECK-NEXT: jal ra, f # Offset: 8
21-
// CHECK-NEXT: jal zero, f # TAILCALL # Offset: 12
19+
// CHECK-NEXT: jalr -0x4(ra) # Offset: 4
20+
// CHECK-NEXT: jal f # Offset: 8
21+
// CHECK-NEXT: j f # TAILCALL # Offset: 12
2222

2323
// CHECK-LABEL: Binary Function "long_tail" after building cfg {
2424
// CHECK: auipc t1, f
25-
// CHECK-NEXT: jalr zero, -0x18(t1) # TAILCALL # Offset: 8
25+
// CHECK-NEXT: jr -0x18(t1) # TAILCALL # Offset: 8
2626

2727
// CHECK-LABEL: Binary Function "compressed_tail" after building cfg {
2828
// CHECK: jr a0 # TAILCALL # Offset: 0

bolt/test/RISCV/relax.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// RUN: llvm-objdump -d %t.bolt | FileCheck --check-prefix=OBJDUMP %s
66

77
// CHECK: Binary Function "_start" after building cfg {
8-
// CHECK: jal ra, near_f
8+
// CHECK: jal near_f
99
// CHECK-NEXT: auipc ra, far_f
10-
// CHECK-NEXT: jalr ra, 0xc(ra)
10+
// CHECK-NEXT: jalr 0xc(ra)
1111
// CHECK-NEXT: j near_f
1212

1313
// CHECK: Binary Function "_start" after fix-riscv-calls {

bolt/test/RISCV/reloc-branch.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.p2align 1
88
// CHECK: Binary Function "_start" after building cfg {
99
_start:
10-
// CHECK: beq zero, zero, .Ltmp0
10+
// CHECK: beqz zero, .Ltmp0
1111
beq zero, zero, 1f
1212
nop
1313
// CHECK: .Ltmp0

bolt/test/RISCV/reloc-jal.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ f:
1414
.globl _start
1515
.p2align 1
1616
_start:
17-
// CHECK: jal ra, f
17+
// CHECK: jal f
1818
jal ra, f
1919
ret
2020
.size _start, .-_start

clang-tools-extra/clang-doc/Serialize.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,11 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
696696

697697
// What this is a specialization of.
698698
auto SpecOf = CTSD->getSpecializedTemplateOrPartial();
699-
if (SpecOf.is<ClassTemplateDecl *>()) {
700-
Specialization.SpecializationOf =
701-
getUSRForDecl(SpecOf.get<ClassTemplateDecl *>());
702-
} else if (SpecOf.is<ClassTemplatePartialSpecializationDecl *>()) {
703-
Specialization.SpecializationOf =
704-
getUSRForDecl(SpecOf.get<ClassTemplatePartialSpecializationDecl *>());
705-
}
699+
if (auto *CTD = dyn_cast<ClassTemplateDecl *>(SpecOf))
700+
Specialization.SpecializationOf = getUSRForDecl(CTD);
701+
else if (auto *CTPSD =
702+
dyn_cast<ClassTemplatePartialSpecializationDecl *>(SpecOf))
703+
Specialization.SpecializationOf = getUSRForDecl(CTPSD);
706704

707705
// Parameters to the specilization. For partial specializations, get the
708706
// parameters "as written" from the ClassTemplatePartialSpecializationDecl

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@ void exportReplacements(const llvm::StringRef MainFilePath,
646646
YAML << TUD;
647647
}
648648

649-
NamesAndOptions
649+
ChecksAndOptions
650650
getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
651-
NamesAndOptions Result;
651+
ChecksAndOptions Result;
652652
ClangTidyOptions Opts;
653653
Opts.Checks = "*";
654654
clang::tidy::ClangTidyContext Context(
@@ -661,7 +661,7 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
661661
}
662662

663663
for (const auto &Factory : Factories)
664-
Result.Names.insert(Factory.getKey());
664+
Result.Checks.insert(Factory.getKey());
665665

666666
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
667667
SmallString<64> Buffer(AnalyzerCheckNamePrefix);
@@ -670,7 +670,7 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
670670
AllowEnablingAnalyzerAlphaCheckers)) {
671671
Buffer.truncate(DefSize);
672672
Buffer.append(AnalyzerCheck);
673-
Result.Names.insert(Buffer);
673+
Result.Checks.insert(Buffer);
674674
}
675675
for (std::string OptionName : {
676676
#define GET_CHECKER_OPTIONS

0 commit comments

Comments
 (0)