Skip to content

Commit 2f7430f

Browse files
committed
compiler: Updates for LLVM/Clang 20 API changes.
1 parent 7792914 commit 2f7430f

File tree

8 files changed

+128
-28
lines changed

8 files changed

+128
-28
lines changed

src/clang.zig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@ pub const APFloatBaseSemantics = enum(c_int) {
112112
IEEEdouble,
113113
IEEEquad,
114114
PPCDoubleDouble,
115+
PPCDoubleDoubleLegacy,
115116
Float8E5M2,
116117
Float8E5M2FNUZ,
117118
Float8E4M3,
118119
Float8E4M3FN,
119120
Float8E4M3FNUZ,
120121
Float8E4M3B11FNUZ,
122+
Float8E3M4,
121123
FloatTF32,
124+
Float8E8M0FNU,
122125
Float6E3M2FN,
123126
Float6E2M3FN,
124127
Float4E2M1FN,
@@ -1166,6 +1169,7 @@ pub const TypeClass = enum(c_int) {
11661169
Elaborated,
11671170
FunctionNoProto,
11681171
FunctionProto,
1172+
HLSLAttributedResource,
11691173
InjectedClassName,
11701174
MacroQualified,
11711175
ConstantMatrix,
@@ -1225,6 +1229,7 @@ const StmtClass = enum(c_int) {
12251229
PackExpansionExprClass,
12261230
UnresolvedMemberExprClass,
12271231
UnresolvedLookupExprClass,
1232+
OpenACCAsteriskSizeExprClass,
12281233
OpaqueValueExprClass,
12291234
OffsetOfExprClass,
12301235
ObjCSubscriptRefExprClass,
@@ -1255,6 +1260,7 @@ const StmtClass = enum(c_int) {
12551260
InitListExprClass,
12561261
ImplicitValueInitExprClass,
12571262
ImaginaryLiteralClass,
1263+
HLSLOutArgExprClass,
12581264
GenericSelectionExprClass,
12591265
GNUNullExprClass,
12601266
FunctionParmPackExprClass,
@@ -1332,13 +1338,24 @@ const StmtClass = enum(c_int) {
13321338
SwitchStmtClass,
13331339
DefaultStmtClass,
13341340
CaseStmtClass,
1341+
SYCLKernelCallStmtClass,
13351342
SEHTryStmtClass,
13361343
SEHLeaveStmtClass,
13371344
SEHFinallyStmtClass,
13381345
SEHExceptStmtClass,
13391346
ReturnStmtClass,
1347+
OpenACCWaitConstructClass,
1348+
OpenACCUpdateConstructClass,
1349+
OpenACCShutdownConstructClass,
1350+
OpenACCSetConstructClass,
1351+
OpenACCInitConstructClass,
1352+
OpenACCExitDataConstructClass,
1353+
OpenACCEnterDataConstructClass,
13401354
OpenACCLoopConstructClass,
1355+
OpenACCHostDataConstructClass,
1356+
OpenACCDataConstructClass,
13411357
OpenACCComputeConstructClass,
1358+
OpenACCCombinedConstructClass,
13421359
ObjCForCollectionStmtClass,
13431360
ObjCAutoreleasePoolStmtClass,
13441361
ObjCAtTryStmtClass,
@@ -1420,6 +1437,7 @@ const StmtClass = enum(c_int) {
14201437
OMPCancelDirectiveClass,
14211438
OMPBarrierDirectiveClass,
14221439
OMPAtomicDirectiveClass,
1440+
OMPAssumeDirectiveClass,
14231441
OMPCanonicalLoopClass,
14241442
NullStmtClass,
14251443
MSDependentExistsStmtClass,
@@ -1514,6 +1532,7 @@ pub const DeclKind = enum(c_int) {
15141532
TranslationUnit,
15151533
TopLevelStmt,
15161534
RequiresExprBody,
1535+
OutlinedFunction,
15171536
LinkageSpec,
15181537
ExternCContext,
15191538
Export,
@@ -1660,6 +1679,7 @@ pub const BuiltinTypeKind = enum(c_int) {
16601679
SveFloat32,
16611680
SveFloat64,
16621681
SveBFloat16,
1682+
SveMFloat8,
16631683
SveInt8x2,
16641684
SveInt16x2,
16651685
SveInt32x2,
@@ -1672,6 +1692,7 @@ pub const BuiltinTypeKind = enum(c_int) {
16721692
SveFloat32x2,
16731693
SveFloat64x2,
16741694
SveBFloat16x2,
1695+
SveMFloat8x2,
16751696
SveInt8x3,
16761697
SveInt16x3,
16771698
SveInt32x3,
@@ -1684,6 +1705,7 @@ pub const BuiltinTypeKind = enum(c_int) {
16841705
SveFloat32x3,
16851706
SveFloat64x3,
16861707
SveBFloat16x3,
1708+
SveMFloat8x3,
16871709
SveInt8x4,
16881710
SveInt16x4,
16891711
SveInt32x4,
@@ -1696,10 +1718,12 @@ pub const BuiltinTypeKind = enum(c_int) {
16961718
SveFloat32x4,
16971719
SveFloat64x4,
16981720
SveBFloat16x4,
1721+
SveMFloat8x4,
16991722
SveBool,
17001723
SveBoolx2,
17011724
SveBoolx4,
17021725
SveCount,
1726+
MFloat8,
17031727
VectorQuad,
17041728
VectorPair,
17051729
RvvInt8mf8,
@@ -2027,6 +2051,8 @@ pub const BuiltinTypeKind = enum(c_int) {
20272051
RvvBFloat16m4x2,
20282052
WasmExternRef,
20292053
AMDGPUBufferRsrc,
2054+
AMDGPUNamedWorkgroupBarrier,
2055+
HLSLResource,
20302056
Void,
20312057
Bool,
20322058
Char_U,

src/codegen/llvm.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,11 @@ pub const Object = struct {
10531053
.is_small = options.is_small,
10541054
.time_report = options.time_report,
10551055
.tsan = options.sanitize_thread,
1056-
.lto = options.lto != .none,
1056+
.lto = switch (options.lto) {
1057+
.none => .None,
1058+
.thin => .ThinPreLink,
1059+
.full => .FullPreLink,
1060+
},
10571061
// https://github.com/ziglang/zig/issues/21215
10581062
.allow_fast_isel = !comp.root_mod.resolved_target.result.cpu.arch.isMIPS(),
10591063
.asm_filename = null,

src/codegen/llvm/bindings.zig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,22 @@ pub const TargetMachine = opaque {
9090
time_report: bool,
9191
tsan: bool,
9292
sancov: bool,
93-
lto: bool,
93+
lto: LtoPhase,
9494
allow_fast_isel: bool,
9595
asm_filename: ?[*:0]const u8,
9696
bin_filename: ?[*:0]const u8,
9797
llvm_ir_filename: ?[*:0]const u8,
9898
bitcode_filename: ?[*:0]const u8,
9999
coverage: Coverage,
100100

101+
pub const LtoPhase = enum(c_int) {
102+
None,
103+
ThinPreLink,
104+
ThinPostLink,
105+
FullPreLink,
106+
FullPostLink,
107+
};
108+
101109
pub const Coverage = extern struct {
102110
CoverageType: Coverage.Type,
103111
IndirectCalls: bool,

0 commit comments

Comments
 (0)