Skip to content

Commit 5e98f8e

Browse files
authored
Merge branch 'main' into fix/163498
2 parents 538f944 + 9fc8ddd commit 5e98f8e

File tree

279 files changed

+6176
-1504
lines changed

Some content is hidden

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

279 files changed

+6176
-1504
lines changed

.ci/generate_test_report_github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import generate_test_report_lib
1010

11+
1112
def compute_platform_title() -> str:
1213
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
1314
# On Linux the machine value is x86_64 on Windows it is AMD64.

.ci/generate_test_report_lib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
100100
)
101101
return output
102102

103+
103104
def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
104105
failures = {}
105106
for results in junit_objects:

bolt/lib/Core/Relocation.cpp

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,41 +1018,15 @@ void Relocation::print(raw_ostream &OS) const {
10181018
default:
10191019
OS << "RType:" << Twine::utohexstr(Type);
10201020
break;
1021-
1022-
case Triple::aarch64: {
1023-
static const char *const AArch64RelocNames[] = {
1024-
#define ELF_RELOC(name, value) #name,
1025-
#include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
1026-
#undef ELF_RELOC
1027-
};
1028-
assert(Type < ArrayRef(AArch64RelocNames).size());
1029-
OS << AArch64RelocNames[Type];
1030-
} break;
1031-
1021+
case Triple::aarch64:
1022+
OS << object::getELFRelocationTypeName(ELF::EM_AARCH64, Type);
1023+
break;
10321024
case Triple::riscv64:
1033-
// RISC-V relocations are not sequentially numbered so we cannot use an
1034-
// array
1035-
switch (Type) {
1036-
default:
1037-
llvm_unreachable("illegal RISC-V relocation");
1038-
#define ELF_RELOC(name, value) \
1039-
case value: \
1040-
OS << #name; \
1025+
OS << object::getELFRelocationTypeName(ELF::EM_RISCV, Type);
10411026
break;
1042-
#include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
1043-
#undef ELF_RELOC
1044-
}
1027+
case Triple::x86_64:
1028+
OS << object::getELFRelocationTypeName(ELF::EM_X86_64, Type);
10451029
break;
1046-
1047-
case Triple::x86_64: {
1048-
static const char *const X86RelocNames[] = {
1049-
#define ELF_RELOC(name, value) #name,
1050-
#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
1051-
#undef ELF_RELOC
1052-
};
1053-
assert(Type < ArrayRef(X86RelocNames).size());
1054-
OS << X86RelocNames[Type];
1055-
} break;
10561030
}
10571031
OS << ", 0x" << Twine::utohexstr(Offset);
10581032
if (Symbol) {

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
640640
Insts[1].addOperand(MCOperand::createImm(0));
641641
Insts[1].addOperand(MCOperand::createImm(0));
642642
setOperandToSymbolRef(Insts[1], /* OpNum */ 2, Target, 0, Ctx,
643-
ELF::R_AARCH64_ADD_ABS_LO12_NC);
643+
isLDRXl(LDRInst) ? ELF::R_AARCH64_LDST64_ABS_LO12_NC
644+
: ELF::R_AARCH64_LDST32_ABS_LO12_NC);
644645
return Insts;
645646
}
646647

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Verify that llvm-bolt correctly prints relocation types.
2+
3+
# REQUIRES: system-linux
4+
5+
# RUN: %clang %cflags -nostartfiles %s -o %t.exe -Wl,-q,--no-relax
6+
# RUN: llvm-bolt %t.exe --print-cfg --print-relocations -o %t.bolt \
7+
# RUN: | FileCheck %s
8+
9+
.section .text
10+
.align 4
11+
.globl _start
12+
.type _start, %function
13+
_start:
14+
15+
adrp x0, _start
16+
# CHECK: adrp
17+
# CHECK-SAME: R_AARCH64_ADR_PREL_PG_HI21
18+
19+
add x0, x0, :lo12:_start
20+
# CHECK-NEXT: add
21+
# CHECK-SAME: R_AARCH64_ADD_ABS_LO12_NC
22+
23+
ret
24+
.size _start, .-_start

clang/include/clang/Basic/AttrDocs.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,9 +3450,9 @@ Mac, and BSD. This attribute has no effect on other targets.
34503450
def MSABIDocs : Documentation {
34513451
let Category = DocCatCallingConvs;
34523452
let Content = [{
3453-
On non-Windows x86_64 targets, this attribute changes the calling convention of
3454-
a function to match the default convention used on Windows x86_64. This
3455-
attribute has no effect on Windows targets or non-x86_64 targets.
3453+
On non-Windows x86_64 and aarch64 targets, this attribute changes the calling convention of
3454+
a function to match the default convention used on Windows. This
3455+
attribute has no effect on Windows targets or non-x86_64, non-aarch64 targets.
34563456
}];
34573457
}
34583458

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
180180
BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_add_i32, "iiQbiiIi", "")
181181

182182
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32, "ffQbiiIi", "", "atomic-fadd-rtn-insts")
183-
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "t", "atomic-buffer-global-pk-add-f16-insts")
183+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "", "atomic-buffer-global-pk-add-f16-insts")
184184

185185
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")
186186
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")

clang/include/clang/Basic/IdentifierTable.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,57 @@ class LangOptions;
4646
class MultiKeywordSelector;
4747
class SourceLocation;
4848

49+
/// Constants for TokenKinds.def
50+
enum TokenKey : unsigned {
51+
KEYC99 = 0x1,
52+
KEYCXX = 0x2,
53+
KEYCXX11 = 0x4,
54+
KEYGNU = 0x8,
55+
KEYMS = 0x10,
56+
BOOLSUPPORT = 0x20,
57+
KEYALTIVEC = 0x40,
58+
KEYNOCXX = 0x80,
59+
KEYBORLAND = 0x100,
60+
KEYOPENCLC = 0x200,
61+
KEYC23 = 0x400,
62+
KEYNOMS18 = 0x800,
63+
KEYNOOPENCL = 0x1000,
64+
WCHARSUPPORT = 0x2000,
65+
HALFSUPPORT = 0x4000,
66+
CHAR8SUPPORT = 0x8000,
67+
KEYOBJC = 0x10000,
68+
KEYZVECTOR = 0x20000,
69+
KEYCOROUTINES = 0x40000,
70+
KEYMODULES = 0x80000,
71+
KEYCXX20 = 0x100000,
72+
KEYOPENCLCXX = 0x200000,
73+
KEYMSCOMPAT = 0x400000,
74+
KEYSYCL = 0x800000,
75+
KEYCUDA = 0x1000000,
76+
KEYZOS = 0x2000000,
77+
KEYNOZOS = 0x4000000,
78+
KEYHLSL = 0x8000000,
79+
KEYFIXEDPOINT = 0x10000000,
80+
KEYMAX = KEYFIXEDPOINT, // The maximum key
81+
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
82+
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
83+
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
84+
};
85+
86+
/// How a keyword is treated in the selected standard. This enum is ordered
87+
/// intentionally so that the value that 'wins' is the most 'permissive'.
88+
enum KeywordStatus {
89+
KS_Unknown, // Not yet calculated. Used when figuring out the status.
90+
KS_Disabled, // Disabled
91+
KS_Future, // Is a keyword in future standard
92+
KS_Extension, // Is an extension
93+
KS_Enabled, // Enabled
94+
};
95+
96+
/// Translates flags as specified in TokenKinds.def into keyword status
97+
/// in the given language standard.
98+
KeywordStatus getKeywordStatus(const LangOptions &LangOpts, unsigned Flags);
99+
49100
enum class ReservedIdentifierStatus {
50101
NotReserved = 0,
51102
StartsWithUnderscoreAtGlobalScope,

clang/include/clang/Basic/SourceManager.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,10 +1409,15 @@ class SourceManager : public RefCountedBase<SourceManager> {
14091409
/// before calling this method.
14101410
unsigned getColumnNumber(FileID FID, unsigned FilePos,
14111411
bool *Invalid = nullptr) const;
1412+
unsigned getColumnNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
14121413
unsigned getSpellingColumnNumber(SourceLocation Loc,
1413-
bool *Invalid = nullptr) const;
1414+
bool *Invalid = nullptr) const {
1415+
return getColumnNumber(getSpellingLoc(Loc), Invalid);
1416+
}
14141417
unsigned getExpansionColumnNumber(SourceLocation Loc,
1415-
bool *Invalid = nullptr) const;
1418+
bool *Invalid = nullptr) const {
1419+
return getColumnNumber(getExpansionLoc(Loc), Invalid);
1420+
}
14161421
unsigned getPresumedColumnNumber(SourceLocation Loc,
14171422
bool *Invalid = nullptr) const;
14181423

@@ -1423,8 +1428,15 @@ class SourceManager : public RefCountedBase<SourceManager> {
14231428
/// MemoryBuffer, so this is not cheap: use only when about to emit a
14241429
/// diagnostic.
14251430
unsigned getLineNumber(FileID FID, unsigned FilePos, bool *Invalid = nullptr) const;
1426-
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1427-
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1431+
unsigned getLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1432+
unsigned getSpellingLineNumber(SourceLocation Loc,
1433+
bool *Invalid = nullptr) const {
1434+
return getLineNumber(getSpellingLoc(Loc), Invalid);
1435+
}
1436+
unsigned getExpansionLineNumber(SourceLocation Loc,
1437+
bool *Invalid = nullptr) const {
1438+
return getLineNumber(getExpansionLoc(Loc), Invalid);
1439+
}
14281440
unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
14291441

14301442
/// Return the filename or buffer identifier of the buffer the

clang/lib/Basic/IdentifierTable.cpp

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,57 +77,6 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts,
7777
// Language Keyword Implementation
7878
//===----------------------------------------------------------------------===//
7979

80-
// Constants for TokenKinds.def
81-
namespace {
82-
83-
enum TokenKey : unsigned {
84-
KEYC99 = 0x1,
85-
KEYCXX = 0x2,
86-
KEYCXX11 = 0x4,
87-
KEYGNU = 0x8,
88-
KEYMS = 0x10,
89-
BOOLSUPPORT = 0x20,
90-
KEYALTIVEC = 0x40,
91-
KEYNOCXX = 0x80,
92-
KEYBORLAND = 0x100,
93-
KEYOPENCLC = 0x200,
94-
KEYC23 = 0x400,
95-
KEYNOMS18 = 0x800,
96-
KEYNOOPENCL = 0x1000,
97-
WCHARSUPPORT = 0x2000,
98-
HALFSUPPORT = 0x4000,
99-
CHAR8SUPPORT = 0x8000,
100-
KEYOBJC = 0x10000,
101-
KEYZVECTOR = 0x20000,
102-
KEYCOROUTINES = 0x40000,
103-
KEYMODULES = 0x80000,
104-
KEYCXX20 = 0x100000,
105-
KEYOPENCLCXX = 0x200000,
106-
KEYMSCOMPAT = 0x400000,
107-
KEYSYCL = 0x800000,
108-
KEYCUDA = 0x1000000,
109-
KEYZOS = 0x2000000,
110-
KEYNOZOS = 0x4000000,
111-
KEYHLSL = 0x8000000,
112-
KEYFIXEDPOINT = 0x10000000,
113-
KEYMAX = KEYFIXEDPOINT, // The maximum key
114-
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
115-
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
116-
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
117-
};
118-
119-
/// How a keyword is treated in the selected standard. This enum is ordered
120-
/// intentionally so that the value that 'wins' is the most 'permissive'.
121-
enum KeywordStatus {
122-
KS_Unknown, // Not yet calculated. Used when figuring out the status.
123-
KS_Disabled, // Disabled
124-
KS_Future, // Is a keyword in future standard
125-
KS_Extension, // Is an extension
126-
KS_Enabled, // Enabled
127-
};
128-
129-
} // namespace
130-
13180
// This works on a single TokenKey flag and checks the LangOpts to get the
13281
// KeywordStatus based exclusively on this flag, so that it can be merged in
13382
// getKeywordStatus. Most should be enabled/disabled, but some might imply
@@ -220,9 +169,7 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
220169
}
221170
}
222171

223-
/// Translates flags as specified in TokenKinds.def into keyword status
224-
/// in the given language standard.
225-
static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
172+
KeywordStatus clang::getKeywordStatus(const LangOptions &LangOpts,
226173
unsigned Flags) {
227174
// KEYALL means always enabled, so special case this one.
228175
if (Flags == KEYALL) return KS_Enabled;

0 commit comments

Comments
 (0)