update Target, CPU, OS, ABI, etc. to LLVM 15

This commit is contained in:
Andrew Kelley 2022-07-31 18:10:28 -07:00
parent d46446e4df
commit 70d3912390
15 changed files with 306 additions and 56 deletions

View File

@ -40,9 +40,11 @@ pub const Target = struct {
nvcl, nvcl,
amdhsa, amdhsa,
ps4, ps4,
ps5,
elfiamcu, elfiamcu,
tvos, tvos,
watchos, watchos,
driverkit,
mesa3d, mesa3d,
contiki, contiki,
amdpal, amdpal,
@ -50,6 +52,7 @@ pub const Target = struct {
hurd, hurd,
wasi, wasi,
emscripten, emscripten,
shadermodel,
uefi, uefi,
opencl, opencl,
glsl450, glsl450,
@ -244,6 +247,7 @@ pub const Target = struct {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -252,6 +256,8 @@ pub const Target = struct {
.hurd, .hurd,
.wasi, .wasi,
.emscripten, .emscripten,
.driverkit,
.shadermodel,
.uefi, .uefi,
.opencl, // TODO: OpenCL versions .opencl, // TODO: OpenCL versions
.glsl450, // TODO: GLSL versions .glsl450, // TODO: GLSL versions
@ -419,6 +425,7 @@ pub const Target = struct {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -427,6 +434,8 @@ pub const Target = struct {
.hurd, .hurd,
.wasi, .wasi,
.emscripten, .emscripten,
.driverkit,
.shadermodel,
.uefi, .uefi,
.opencl, .opencl,
.glsl450, .glsl450,
@ -481,6 +490,21 @@ pub const Target = struct {
coreclr, coreclr,
simulator, simulator,
macabi, macabi,
pixel,
vertex,
geometry,
hull,
domain,
compute,
library,
raygeneration,
intersection,
anyhit,
closesthit,
miss,
callable,
mesh,
amplification,
pub fn default(arch: Cpu.Arch, target_os: Os) Abi { pub fn default(arch: Cpu.Arch, target_os: Os) Abi {
if (arch.isWasm()) { if (arch.isWasm()) {
@ -502,6 +526,7 @@ pub const Target = struct {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -531,6 +556,8 @@ pub const Target = struct {
.ios, .ios,
.tvos, .tvos,
.watchos, .watchos,
.driverkit,
.shadermodel,
=> return .none, => return .none,
} }
} }
@ -563,16 +590,18 @@ pub const Target = struct {
pub const ObjectFormat = enum { pub const ObjectFormat = enum {
/// Common Object File Format (Windows) /// Common Object File Format (Windows)
coff, coff,
/// DirectX Container
dxcontainer,
/// Executable and Linking Format /// Executable and Linking Format
elf, elf,
/// macOS relocatables /// macOS relocatables
macho, macho,
/// Standard, Portable Intermediate Representation V
spirv,
/// WebAssembly /// WebAssembly
wasm, wasm,
/// C source code /// C source code
c, c,
/// Standard, Portable Intermediate Representation V
spirv,
/// Intel IHEX /// Intel IHEX
hex, hex,
/// Machine code with no metadata. /// Machine code with no metadata.
@ -592,6 +621,7 @@ pub const Target = struct {
.raw => ".bin", .raw => ".bin",
.plan9 => plan9Ext(cpu_arch), .plan9 => plan9Ext(cpu_arch),
.nvptx => ".ptx", .nvptx => ".ptx",
.dxcontainer => @panic("TODO what's the extension for these?"),
}; };
} }
}; };
@ -769,7 +799,10 @@ pub const Target = struct {
bpfel, bpfel,
bpfeb, bpfeb,
csky, csky,
dxil,
hexagon, hexagon,
loongarch32,
loongarch64,
m68k, m68k,
mips, mips,
mipsel, mipsel,
@ -920,6 +953,7 @@ pub const Target = struct {
.arm => .ARM, .arm => .ARM,
.armeb => .ARM, .armeb => .ARM,
.hexagon => .HEXAGON, .hexagon => .HEXAGON,
.dxil => .NONE,
.m68k => .@"68K", .m68k => .@"68K",
.le32 => .NONE, .le32 => .NONE,
.mips => .MIPS, .mips => .MIPS,
@ -970,6 +1004,8 @@ pub const Target = struct {
.spu_2 => .SPU_2, .spu_2 => .SPU_2,
.spirv32 => .NONE, .spirv32 => .NONE,
.spirv64 => .NONE, .spirv64 => .NONE,
.loongarch32 => .NONE,
.loongarch64 => .NONE,
}; };
} }
@ -980,6 +1016,7 @@ pub const Target = struct {
.arc => .Unknown, .arc => .Unknown,
.arm => .ARM, .arm => .ARM,
.armeb => .Unknown, .armeb => .Unknown,
.dxil => .Unknown,
.hexagon => .Unknown, .hexagon => .Unknown,
.m68k => .Unknown, .m68k => .Unknown,
.le32 => .Unknown, .le32 => .Unknown,
@ -1031,6 +1068,8 @@ pub const Target = struct {
.spu_2 => .Unknown, .spu_2 => .Unknown,
.spirv32 => .Unknown, .spirv32 => .Unknown,
.spirv64 => .Unknown, .spirv64 => .Unknown,
.loongarch32 => .Unknown,
.loongarch64 => .Unknown,
}; };
} }
@ -1079,6 +1118,9 @@ pub const Target = struct {
// GPU bitness is opaque. For now, assume little endian. // GPU bitness is opaque. For now, assume little endian.
.spirv32, .spirv32,
.spirv64, .spirv64,
.dxil,
.loongarch32,
.loongarch64,
=> .Little, => .Little,
.arc, .arc,
@ -1139,6 +1181,8 @@ pub const Target = struct {
.renderscript32, .renderscript32,
.aarch64_32, .aarch64_32,
.spirv32, .spirv32,
.loongarch32,
.dxil,
=> return 32, => return 32,
.aarch64, .aarch64,
@ -1163,6 +1207,7 @@ pub const Target = struct {
.s390x, .s390x,
.ve, .ve,
.spirv64, .spirv64,
.loongarch64,
=> return 64, => return 64,
} }
} }
@ -1636,6 +1681,9 @@ pub const Target = struct {
.renderscript32, .renderscript32,
.renderscript64, .renderscript64,
.ve, .ve,
.dxil,
.loongarch32,
.loongarch64,
=> return result, => return result,
}, },
@ -1678,12 +1726,15 @@ pub const Target = struct {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
.amdpal, .amdpal,
.hermit, .hermit,
.hurd, .hurd,
.driverkit,
.shadermodel,
=> return result, => return result,
} }
} }
@ -1852,6 +1903,9 @@ pub const Target = struct {
.renderscript64, .renderscript64,
.ve, .ve,
.spirv64, .spirv64,
.dxil,
.loongarch32,
.loongarch64,
=> 16, => 16,
}; };
} }

View File

@ -190,6 +190,7 @@ pub fn binNameAlloc(allocator: std.mem.Allocator, options: BinNameOptions) error
.Lib => return std.fmt.allocPrint(allocator, "{s}{s}.a", .{ target.libPrefix(), root_name }), .Lib => return std.fmt.allocPrint(allocator, "{s}{s}.a", .{ target.libPrefix(), root_name }),
}, },
.nvptx => return std.fmt.allocPrint(allocator, "{s}", .{root_name}), .nvptx => return std.fmt.allocPrint(allocator, "{s}", .{root_name}),
.dxcontainer => @panic("TODO what's the file extension for these?"),
} }
} }

View File

@ -118,6 +118,7 @@ fn updateOsVersionRange(self: *CrossTarget, os: Target.Os) void {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -126,6 +127,8 @@ fn updateOsVersionRange(self: *CrossTarget, os: Target.Os) void {
.hurd, .hurd,
.wasi, .wasi,
.emscripten, .emscripten,
.driverkit,
.shadermodel,
.uefi, .uefi,
.opencl, .opencl,
.glsl450, .glsl450,
@ -663,6 +666,7 @@ fn parseOs(result: *CrossTarget, diags: *ParseOptions.Diagnostics, text: []const
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -676,6 +680,8 @@ fn parseOs(result: *CrossTarget, diags: *ParseOptions.Diagnostics, text: []const
.glsl450, .glsl450,
.vulkan, .vulkan,
.plan9, .plan9,
.driverkit,
.shadermodel,
.other, .other,
=> return error.InvalidOperatingSystemVersion, => return error.InvalidOperatingSystemVersion,

View File

@ -859,7 +859,7 @@ pub const StmtExpr = opaque {
pub const StringLiteral = opaque { pub const StringLiteral = opaque {
pub const getKind = ZigClangStringLiteral_getKind; pub const getKind = ZigClangStringLiteral_getKind;
extern fn ZigClangStringLiteral_getKind(*const StringLiteral) StringLiteral_StringKind; extern fn ZigClangStringLiteral_getKind(*const StringLiteral) CharacterLiteral_CharacterKind;
pub const getCodeUnit = ZigClangStringLiteral_getCodeUnit; pub const getCodeUnit = ZigClangStringLiteral_getCodeUnit;
extern fn ZigClangStringLiteral_getCodeUnit(*const StringLiteral, usize) u32; extern fn ZigClangStringLiteral_getCodeUnit(*const StringLiteral, usize) u32;
@ -1117,6 +1117,7 @@ pub const TypeClass = enum(c_int) {
VariableArray, VariableArray,
Atomic, Atomic,
Attributed, Attributed,
BTFTagAttributed,
BitInt, BitInt,
BlockPointer, BlockPointer,
Builtin, Builtin,
@ -1202,25 +1203,33 @@ const StmtClass = enum(c_int) {
OMPForDirectiveClass, OMPForDirectiveClass,
OMPForSimdDirectiveClass, OMPForSimdDirectiveClass,
OMPGenericLoopDirectiveClass, OMPGenericLoopDirectiveClass,
OMPMaskedTaskLoopDirectiveClass,
OMPMaskedTaskLoopSimdDirectiveClass,
OMPMasterTaskLoopDirectiveClass, OMPMasterTaskLoopDirectiveClass,
OMPMasterTaskLoopSimdDirectiveClass, OMPMasterTaskLoopSimdDirectiveClass,
OMPParallelForDirectiveClass, OMPParallelForDirectiveClass,
OMPParallelForSimdDirectiveClass, OMPParallelForSimdDirectiveClass,
OMPParallelGenericLoopDirectiveClass,
OMPParallelMaskedTaskLoopDirectiveClass,
OMPParallelMaskedTaskLoopSimdDirectiveClass,
OMPParallelMasterTaskLoopDirectiveClass, OMPParallelMasterTaskLoopDirectiveClass,
OMPParallelMasterTaskLoopSimdDirectiveClass, OMPParallelMasterTaskLoopSimdDirectiveClass,
OMPSimdDirectiveClass, OMPSimdDirectiveClass,
OMPTargetParallelForSimdDirectiveClass, OMPTargetParallelForSimdDirectiveClass,
OMPTargetParallelGenericLoopDirectiveClass,
OMPTargetSimdDirectiveClass, OMPTargetSimdDirectiveClass,
OMPTargetTeamsDistributeDirectiveClass, OMPTargetTeamsDistributeDirectiveClass,
OMPTargetTeamsDistributeParallelForDirectiveClass, OMPTargetTeamsDistributeParallelForDirectiveClass,
OMPTargetTeamsDistributeParallelForSimdDirectiveClass, OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
OMPTargetTeamsDistributeSimdDirectiveClass, OMPTargetTeamsDistributeSimdDirectiveClass,
OMPTargetTeamsGenericLoopDirectiveClass,
OMPTaskLoopDirectiveClass, OMPTaskLoopDirectiveClass,
OMPTaskLoopSimdDirectiveClass, OMPTaskLoopSimdDirectiveClass,
OMPTeamsDistributeDirectiveClass, OMPTeamsDistributeDirectiveClass,
OMPTeamsDistributeParallelForDirectiveClass, OMPTeamsDistributeParallelForDirectiveClass,
OMPTeamsDistributeParallelForSimdDirectiveClass, OMPTeamsDistributeParallelForSimdDirectiveClass,
OMPTeamsDistributeSimdDirectiveClass, OMPTeamsDistributeSimdDirectiveClass,
OMPTeamsGenericLoopDirectiveClass,
OMPTileDirectiveClass, OMPTileDirectiveClass,
OMPUnrollDirectiveClass, OMPUnrollDirectiveClass,
OMPMaskedDirectiveClass, OMPMaskedDirectiveClass,
@ -1228,6 +1237,7 @@ const StmtClass = enum(c_int) {
OMPMetaDirectiveClass, OMPMetaDirectiveClass,
OMPOrderedDirectiveClass, OMPOrderedDirectiveClass,
OMPParallelDirectiveClass, OMPParallelDirectiveClass,
OMPParallelMaskedDirectiveClass,
OMPParallelMasterDirectiveClass, OMPParallelMasterDirectiveClass,
OMPParallelSectionsDirectiveClass, OMPParallelSectionsDirectiveClass,
OMPScanDirectiveClass, OMPScanDirectiveClass,
@ -1532,6 +1542,7 @@ pub const DeclKind = enum(c_int) {
OMPDeclareMapper, OMPDeclareMapper,
OMPDeclareReduction, OMPDeclareReduction,
TemplateParamObject, TemplateParamObject,
UnnamedGlobalConstant,
UnresolvedUsingValue, UnresolvedUsingValue,
OMPAllocate, OMPAllocate,
OMPRequires, OMPRequires,
@ -1805,6 +1816,8 @@ pub const CallingConv = enum(c_int) {
PreserveMost, PreserveMost,
PreserveAll, PreserveAll,
AArch64VectorCall, AArch64VectorCall,
AArch64SVEPCS,
AMDGPUKernelCall,
}; };
pub const StorageClass = enum(c_int) { pub const StorageClass = enum(c_int) {
@ -1826,14 +1839,6 @@ pub const APFloat_roundingMode = enum(i8) {
Invalid = -1, Invalid = -1,
}; };
pub const StringLiteral_StringKind = enum(c_int) {
Ascii,
Wide,
UTF8,
UTF16,
UTF32,
};
pub const CharacterLiteral_CharacterKind = enum(c_int) { pub const CharacterLiteral_CharacterKind = enum(c_int) {
Ascii, Ascii,
Wide, Wide,

View File

@ -41,7 +41,10 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
.bpfel => "bpfel", .bpfel => "bpfel",
.bpfeb => "bpfeb", .bpfeb => "bpfeb",
.csky => "csky", .csky => "csky",
.dxil => "dxil",
.hexagon => "hexagon", .hexagon => "hexagon",
.loongarch32 => "loongarch32",
.loongarch64 => "loongarch64",
.m68k => "m68k", .m68k => "m68k",
.mips => "mips", .mips => "mips",
.mipsel => "mipsel", .mipsel => "mipsel",
@ -116,6 +119,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
.nvcl => "nvcl", .nvcl => "nvcl",
.amdhsa => "amdhsa", .amdhsa => "amdhsa",
.ps4 => "ps4", .ps4 => "ps4",
.ps5 => "ps5",
.elfiamcu => "elfiamcu", .elfiamcu => "elfiamcu",
.mesa3d => "mesa3d", .mesa3d => "mesa3d",
.contiki => "contiki", .contiki => "contiki",
@ -129,6 +133,8 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
.ios => "ios", .ios => "ios",
.tvos => "tvos", .tvos => "tvos",
.watchos => "watchos", .watchos => "watchos",
.driverkit => "driverkit",
.shadermodel => "shadermodel",
.opencl, .opencl,
.glsl450, .glsl450,
.vulkan, .vulkan,
@ -171,6 +177,21 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 {
.coreclr => "coreclr", .coreclr => "coreclr",
.simulator => "simulator", .simulator => "simulator",
.macabi => "macabi", .macabi => "macabi",
.pixel => "pixel",
.vertex => "vertex",
.geometry => "geometry",
.hull => "hull",
.domain => "domain",
.compute => "compute",
.library => "library",
.raygeneration => "raygeneration",
.intersection => "intersection",
.anyhit => "anyhit",
.closesthit => "closesthit",
.miss => "miss",
.callable => "callable",
.mesh => "mesh",
.amplification => "amplification",
}; };
try llvm_triple.appendSlice(llvm_abi); try llvm_triple.appendSlice(llvm_abi);
@ -9030,6 +9051,9 @@ fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
.kalimba, .kalimba,
.renderscript32, .renderscript32,
.renderscript64, .renderscript64,
.dxil,
.loongarch32,
.loongarch64,
=> {}, => {},
.spu_2 => unreachable, // LLVM does not support this backend .spu_2 => unreachable, // LLVM does not support this backend

View File

@ -1212,9 +1212,11 @@ pub const LinkWasm = ZigLLDLinkWasm;
pub const ObjectFormatType = enum(c_int) { pub const ObjectFormatType = enum(c_int) {
Unknown, Unknown,
COFF, COFF,
DXContainer,
ELF, ELF,
GOFF, GOFF,
MachO, MachO,
SPIRV,
Wasm, Wasm,
XCOFF, XCOFF,
}; };
@ -1254,9 +1256,11 @@ pub const OSType = enum(c_int) {
NVCL, NVCL,
AMDHSA, AMDHSA,
PS4, PS4,
PS5,
ELFIAMCU, ELFIAMCU,
TvOS, TvOS,
WatchOS, WatchOS,
DriverKit,
Mesa3D, Mesa3D,
Contiki, Contiki,
AMDPAL, AMDPAL,
@ -1264,6 +1268,7 @@ pub const OSType = enum(c_int) {
Hurd, Hurd,
WASI, WASI,
Emscripten, Emscripten,
ShaderModel,
}; };
pub const ArchType = enum(c_int) { pub const ArchType = enum(c_int) {
@ -1278,7 +1283,10 @@ pub const ArchType = enum(c_int) {
bpfel, bpfel,
bpfeb, bpfeb,
csky, csky,
dxil,
hexagon, hexagon,
loongarch32,
loongarch64,
m68k, m68k,
mips, mips,
mipsel, mipsel,
@ -1314,6 +1322,8 @@ pub const ArchType = enum(c_int) {
hsail64, hsail64,
spir, spir,
spir64, spir64,
spirv32,
spirv64,
kalimba, kalimba,
shave, shave,
lanai, lanai,

View File

@ -290,6 +290,7 @@ pub const File = struct {
.nvptx => &(try NvPtx.createEmpty(allocator, options)).base, .nvptx => &(try NvPtx.createEmpty(allocator, options)).base,
.hex => return error.HexObjectFormatUnimplemented, .hex => return error.HexObjectFormatUnimplemented,
.raw => return error.RawObjectFormatUnimplemented, .raw => return error.RawObjectFormatUnimplemented,
.dxcontainer => return error.DirectXContainerObjectFormatUnimplemented,
}; };
} }
const emit = options.emit.?; const emit = options.emit.?;
@ -309,6 +310,7 @@ pub const File = struct {
.nvptx => &(try NvPtx.createEmpty(allocator, options)).base, .nvptx => &(try NvPtx.createEmpty(allocator, options)).base,
.hex => return error.HexObjectFormatUnimplemented, .hex => return error.HexObjectFormatUnimplemented,
.raw => return error.RawObjectFormatUnimplemented, .raw => return error.RawObjectFormatUnimplemented,
.dxcontainer => return error.DirectXContainerObjectFormatUnimplemented,
}; };
} }
// Open a temporary object file, not the final output file because we // Open a temporary object file, not the final output file because we
@ -330,6 +332,7 @@ pub const File = struct {
.nvptx => &(try NvPtx.openPath(allocator, sub_path, options)).base, .nvptx => &(try NvPtx.openPath(allocator, sub_path, options)).base,
.hex => return error.HexObjectFormatUnimplemented, .hex => return error.HexObjectFormatUnimplemented,
.raw => return error.RawObjectFormatUnimplemented, .raw => return error.RawObjectFormatUnimplemented,
.dxcontainer => return error.DirectXContainerObjectFormatUnimplemented,
}; };
if (use_lld) { if (use_lld) {

View File

@ -83,9 +83,11 @@ enum Os {
OsNVCL, // NVIDIA OpenCL OsNVCL, // NVIDIA OpenCL
OsAMDHSA, // AMD HSA Runtime OsAMDHSA, // AMD HSA Runtime
OsPS4, OsPS4,
OsPS5,
OsELFIAMCU, OsELFIAMCU,
OsTvOS, // Apple tvOS OsTvOS, // Apple tvOS
OsWatchOS, // Apple watchOS OsWatchOS, // Apple watchOS
OsDriverKit, // Apple DriverKit
OsMesa3D, OsMesa3D,
OsContiki, OsContiki,
OsAMDPAL, OsAMDPAL,
@ -93,6 +95,7 @@ enum Os {
OsHurd, OsHurd,
OsWASI, OsWASI,
OsEmscripten, OsEmscripten,
OsShaderModel, // DirectX ShaderModel
OsUefi, OsUefi,
OsOpenCL, OsOpenCL,
OsGLSL450, OsGLSL450,

View File

@ -24,7 +24,10 @@ static const ZigLLVM_ArchType arch_list[] = {
ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian) ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian) ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
ZigLLVM_csky, // CSKY: csky ZigLLVM_csky, // CSKY: csky
ZigLLVM_dxil, // DXIL 32-bit DirectX bytecode
ZigLLVM_hexagon, // Hexagon: hexagon ZigLLVM_hexagon, // Hexagon: hexagon
ZigLLVM_loongarch32, // LoongArch (32-bit): loongarch32
ZigLLVM_loongarch64, // LoongArch (64-bit): loongarch64
ZigLLVM_m68k, // M68k: Motorola 680x0 family ZigLLVM_m68k, // M68k: Motorola 680x0 family
ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
@ -114,9 +117,11 @@ static const Os os_list[] = {
OsNVCL, // NVIDIA OpenCL OsNVCL, // NVIDIA OpenCL
OsAMDHSA, // AMD HSA Runtime OsAMDHSA, // AMD HSA Runtime
OsPS4, OsPS4,
OsPS5,
OsELFIAMCU, OsELFIAMCU,
OsTvOS, // Apple tvOS OsTvOS, // Apple tvOS
OsWatchOS, // Apple watchOS OsWatchOS, // Apple watchOS
OsDriverKit, // Apple DriverKit
OsMesa3D, OsMesa3D,
OsContiki, OsContiki,
OsAMDPAL, OsAMDPAL,
@ -124,6 +129,7 @@ static const Os os_list[] = {
OsHurd, OsHurd,
OsWASI, OsWASI,
OsEmscripten, OsEmscripten,
OsShaderModel, // DirectX ShaderModel
OsUefi, OsUefi,
OsOpenCL, OsOpenCL,
OsGLSL450, OsGLSL450,
@ -156,16 +162,34 @@ static const ZigLLVM_EnvironmentType abi_list[] = {
ZigLLVM_Itanium, ZigLLVM_Itanium,
ZigLLVM_Cygnus, ZigLLVM_Cygnus,
ZigLLVM_CoreCLR, ZigLLVM_CoreCLR,
ZigLLVM_Simulator, ZigLLVM_Simulator, // Simulator variants of other systems, e.g., Apple's iOS
ZigLLVM_MacABI, ZigLLVM_MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
ZigLLVM_Pixel,
ZigLLVM_Vertex,
ZigLLVM_Geometry,
ZigLLVM_Hull,
ZigLLVM_Domain,
ZigLLVM_Compute,
ZigLLVM_Library,
ZigLLVM_RayGeneration,
ZigLLVM_Intersection,
ZigLLVM_AnyHit,
ZigLLVM_ClosestHit,
ZigLLVM_Miss,
ZigLLVM_Callable,
ZigLLVM_Mesh,
ZigLLVM_Amplification,
}; };
static const ZigLLVM_ObjectFormatType oformat_list[] = { static const ZigLLVM_ObjectFormatType oformat_list[] = {
ZigLLVM_UnknownObjectFormat, ZigLLVM_UnknownObjectFormat,
ZigLLVM_COFF, ZigLLVM_COFF,
ZigLLVM_DXContainer,
ZigLLVM_ELF, ZigLLVM_ELF,
ZigLLVM_GOFF, ZigLLVM_GOFF,
ZigLLVM_MachO, ZigLLVM_MachO,
ZigLLVM_SPIRV,
ZigLLVM_Wasm, ZigLLVM_Wasm,
ZigLLVM_XCOFF, ZigLLVM_XCOFF,
}; };
@ -183,9 +207,11 @@ const char *target_oformat_name(ZigLLVM_ObjectFormatType oformat) {
switch (oformat) { switch (oformat) {
case ZigLLVM_UnknownObjectFormat: return "unknown"; case ZigLLVM_UnknownObjectFormat: return "unknown";
case ZigLLVM_COFF: return "coff"; case ZigLLVM_COFF: return "coff";
case ZigLLVM_DXContainer: return "dxcontainer";
case ZigLLVM_ELF: return "elf"; case ZigLLVM_ELF: return "elf";
case ZigLLVM_GOFF: return "goff"; case ZigLLVM_GOFF: return "goff";
case ZigLLVM_MachO: return "macho"; case ZigLLVM_MachO: return "macho";
case ZigLLVM_SPIRV: return "spirv";
case ZigLLVM_Wasm: return "wasm"; case ZigLLVM_Wasm: return "wasm";
case ZigLLVM_XCOFF: return "xcoff"; case ZigLLVM_XCOFF: return "xcoff";
} }
@ -276,12 +302,16 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
return ZigLLVM_AMDHSA; return ZigLLVM_AMDHSA;
case OsPS4: case OsPS4:
return ZigLLVM_PS4; return ZigLLVM_PS4;
case OsPS5:
return ZigLLVM_PS5;
case OsELFIAMCU: case OsELFIAMCU:
return ZigLLVM_ELFIAMCU; return ZigLLVM_ELFIAMCU;
case OsTvOS: case OsTvOS:
return ZigLLVM_TvOS; return ZigLLVM_TvOS;
case OsWatchOS: case OsWatchOS:
return ZigLLVM_WatchOS; return ZigLLVM_WatchOS;
case OsDriverKit:
return ZigLLVM_DriverKit;
case OsMesa3D: case OsMesa3D:
return ZigLLVM_Mesa3D; return ZigLLVM_Mesa3D;
case OsContiki: case OsContiki:
@ -296,6 +326,8 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
return ZigLLVM_WASI; return ZigLLVM_WASI;
case OsEmscripten: case OsEmscripten:
return ZigLLVM_Emscripten; return ZigLLVM_Emscripten;
case OsShaderModel:
return ZigLLVM_ShaderModel;
} }
zig_unreachable(); zig_unreachable();
} }
@ -334,9 +366,11 @@ const char *target_os_name(Os os_type) {
case OsNVCL: // NVIDIA OpenCL case OsNVCL: // NVIDIA OpenCL
case OsAMDHSA: // AMD HSA Runtime case OsAMDHSA: // AMD HSA Runtime
case OsPS4: case OsPS4:
case OsPS5:
case OsELFIAMCU: case OsELFIAMCU:
case OsTvOS: // Apple tvOS case OsTvOS: // Apple tvOS
case OsWatchOS: // Apple watchOS case OsWatchOS: // Apple watchOS
case OsDriverKit:
case OsMesa3D: case OsMesa3D:
case OsContiki: case OsContiki:
case OsAMDPAL: case OsAMDPAL:
@ -344,6 +378,7 @@ const char *target_os_name(Os os_type) {
case OsHurd: case OsHurd:
case OsWASI: case OsWASI:
case OsEmscripten: case OsEmscripten:
case OsShaderModel:
case OsOpenCL: case OsOpenCL:
case OsGLSL450: case OsGLSL450:
case OsVulkan: case OsVulkan:
@ -532,6 +567,8 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
case ZigLLVM_aarch64_32: case ZigLLVM_aarch64_32:
case ZigLLVM_csky: case ZigLLVM_csky:
case ZigLLVM_spirv32: case ZigLLVM_spirv32:
case ZigLLVM_loongarch32:
case ZigLLVM_dxil:
return 32; return 32;
case ZigLLVM_aarch64: case ZigLLVM_aarch64:
@ -556,6 +593,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
case ZigLLVM_renderscript64: case ZigLLVM_renderscript64:
case ZigLLVM_ve: case ZigLLVM_ve:
case ZigLLVM_spirv64: case ZigLLVM_spirv64:
case ZigLLVM_loongarch64:
return 64; return 64;
} }
zig_unreachable(); zig_unreachable();
@ -601,6 +639,8 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
case ZigLLVM_renderscript32: case ZigLLVM_renderscript32:
case ZigLLVM_csky: case ZigLLVM_csky:
case ZigLLVM_spirv32: case ZigLLVM_spirv32:
case ZigLLVM_loongarch32:
case ZigLLVM_dxil:
return 32; return 32;
case ZigLLVM_aarch64: case ZigLLVM_aarch64:
@ -625,6 +665,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
case ZigLLVM_renderscript64: case ZigLLVM_renderscript64:
case ZigLLVM_ve: case ZigLLVM_ve:
case ZigLLVM_spirv64: case ZigLLVM_spirv64:
case ZigLLVM_loongarch64:
return 64; return 64;
case ZigLLVM_x86_64: case ZigLLVM_x86_64:
@ -751,6 +792,7 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
case OsAIX: case OsAIX:
case OsAMDHSA: case OsAMDHSA:
case OsPS4: case OsPS4:
case OsPS5:
case OsELFIAMCU: case OsELFIAMCU:
case OsTvOS: case OsTvOS:
case OsWatchOS: case OsWatchOS:
@ -763,6 +805,8 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
case OsOpenCL: case OsOpenCL:
case OsGLSL450: case OsGLSL450:
case OsVulkan: case OsVulkan:
case OsDriverKit:
case OsShaderModel:
zig_panic("TODO c type size in bits for this target"); zig_panic("TODO c type size in bits for this target");
} }
zig_unreachable(); zig_unreachable();
@ -860,6 +904,9 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
case ZigLLVM_tcele: case ZigLLVM_tcele:
case ZigLLVM_xcore: case ZigLLVM_xcore:
case ZigLLVM_ve: case ZigLLVM_ve:
case ZigLLVM_dxil:
case ZigLLVM_loongarch32:
case ZigLLVM_loongarch64:
zig_panic("TODO populate this table with stack pointer register name for this CPU architecture"); zig_panic("TODO populate this table with stack pointer register name for this CPU architecture");
} }
zig_unreachable(); zig_unreachable();
@ -927,6 +974,9 @@ bool target_is_arm(const ZigTarget *target) {
case ZigLLVM_ve: case ZigLLVM_ve:
case ZigLLVM_spirv32: case ZigLLVM_spirv32:
case ZigLLVM_spirv64: case ZigLLVM_spirv64:
case ZigLLVM_dxil:
case ZigLLVM_loongarch32:
case ZigLLVM_loongarch64:
return false; return false;
} }
zig_unreachable(); zig_unreachable();
@ -973,6 +1023,7 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
case OsNVCL: case OsNVCL:
case OsAMDHSA: case OsAMDHSA:
case OsPS4: case OsPS4:
case OsPS5:
case OsELFIAMCU: case OsELFIAMCU:
case OsMesa3D: case OsMesa3D:
case OsContiki: case OsContiki:
@ -1004,6 +1055,8 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
case OsIOS: case OsIOS:
case OsTvOS: case OsTvOS:
case OsWatchOS: case OsWatchOS:
case OsDriverKit:
case OsShaderModel:
return ZigLLVM_UnknownEnvironment; return ZigLLVM_UnknownEnvironment;
} }
zig_unreachable(); zig_unreachable();

View File

@ -112,6 +112,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
return OsAMDHSA; return OsAMDHSA;
case ZigLLVM_PS4: case ZigLLVM_PS4:
return OsPS4; return OsPS4;
case ZigLLVM_PS5:
return OsPS5;
case ZigLLVM_ELFIAMCU: case ZigLLVM_ELFIAMCU:
return OsELFIAMCU; return OsELFIAMCU;
case ZigLLVM_TvOS: case ZigLLVM_TvOS:
@ -132,6 +134,10 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
return OsWASI; return OsWASI;
case ZigLLVM_Emscripten: case ZigLLVM_Emscripten:
return OsEmscripten; return OsEmscripten;
case ZigLLVM_DriverKit:
return OsDriverKit;
case ZigLLVM_ShaderModel:
return OsShaderModel;
} }
zig_unreachable(); zig_unreachable();
} }

View File

@ -107,6 +107,23 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {
.simulator, .simulator,
.macabi, .macabi,
=> unreachable, => unreachable,
.pixel,
.vertex,
.geometry,
.hull,
.domain,
.compute,
.library,
.raygeneration,
.intersection,
.anyhit,
.closesthit,
.miss,
.callable,
.mesh,
.amplification,
=> unreachable,
} }
} }
@ -219,6 +236,7 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
.hex, .hex,
.raw, .raw,
.nvptx, .nvptx,
.dxcontainer,
=> {}, => {},
} }
@ -233,7 +251,10 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
.bpfel, .bpfel,
.bpfeb, .bpfeb,
.csky, .csky,
.dxil,
.hexagon, .hexagon,
.loongarch32,
.loongarch64,
.m68k, .m68k,
.mips, .mips,
.mipsel, .mipsel,
@ -335,6 +356,7 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
.nvcl => .NVCL, .nvcl => .NVCL,
.amdhsa => .AMDHSA, .amdhsa => .AMDHSA,
.ps4 => .PS4, .ps4 => .PS4,
.ps5 => .PS5,
.elfiamcu => .ELFIAMCU, .elfiamcu => .ELFIAMCU,
.tvos => .TvOS, .tvos => .TvOS,
.watchos => .WatchOS, .watchos => .WatchOS,
@ -345,6 +367,8 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
.hurd => .Hurd, .hurd => .Hurd,
.wasi => .WASI, .wasi => .WASI,
.emscripten => .Emscripten, .emscripten => .Emscripten,
.driverkit => .DriverKit,
.shadermodel => .ShaderModel,
}; };
} }
@ -360,7 +384,10 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
.bpfel => .bpfel, .bpfel => .bpfel,
.bpfeb => .bpfeb, .bpfeb => .bpfeb,
.csky => .csky, .csky => .csky,
.dxil => .dxil,
.hexagon => .hexagon, .hexagon => .hexagon,
.loongarch32 => .loongarch32,
.loongarch64 => .loongarch64,
.m68k => .m68k, .m68k => .m68k,
.mips => .mips, .mips => .mips,
.mipsel => .mipsel, .mipsel => .mipsel,
@ -627,6 +654,8 @@ pub fn atomicPtrAlignment(
.renderscript32, .renderscript32,
.csky, .csky,
.spirv32, .spirv32,
.dxil,
.loongarch32,
=> 32, => 32,
.aarch64, .aarch64,
@ -651,6 +680,7 @@ pub fn atomicPtrAlignment(
.renderscript64, .renderscript64,
.ve, .ve,
.spirv64, .spirv64,
.loongarch64,
=> 64, => 64,
.x86_64 => 128, .x86_64 => 128,

View File

@ -6627,6 +6627,7 @@ pub const CType = enum {
.nvcl, .nvcl,
.amdhsa, .amdhsa,
.ps4, .ps4,
.ps5,
.elfiamcu, .elfiamcu,
.mesa3d, .mesa3d,
.contiki, .contiki,
@ -6636,6 +6637,8 @@ pub const CType = enum {
.opencl, .opencl,
.glsl450, .glsl450,
.vulkan, .vulkan,
.driverkit,
.shadermodel,
=> @panic("TODO specify the C integer and float type sizes for this OS"), => @panic("TODO specify the C integer and float type sizes for this OS"),
} }
} }

View File

@ -317,6 +317,7 @@ void ZigClang_detect_enum_TypeClass(clang::Type::TypeClass ty) {
case clang::Type::Enum: case clang::Type::Enum:
case clang::Type::Elaborated: case clang::Type::Elaborated:
case clang::Type::Attributed: case clang::Type::Attributed:
case clang::Type::BTFTagAttributed:
case clang::Type::BitInt: case clang::Type::BitInt:
case clang::Type::TemplateTypeParm: case clang::Type::TemplateTypeParm:
case clang::Type::SubstTemplateTypeParm: case clang::Type::SubstTemplateTypeParm:
@ -346,6 +347,7 @@ static_assert((clang::Type::TypeClass)ZigClangType_IncompleteArray == clang::Typ
static_assert((clang::Type::TypeClass)ZigClangType_VariableArray == clang::Type::VariableArray, ""); static_assert((clang::Type::TypeClass)ZigClangType_VariableArray == clang::Type::VariableArray, "");
static_assert((clang::Type::TypeClass)ZigClangType_Atomic == clang::Type::Atomic, ""); static_assert((clang::Type::TypeClass)ZigClangType_Atomic == clang::Type::Atomic, "");
static_assert((clang::Type::TypeClass)ZigClangType_Attributed == clang::Type::Attributed, ""); static_assert((clang::Type::TypeClass)ZigClangType_Attributed == clang::Type::Attributed, "");
static_assert((clang::Type::TypeClass)ZigClangType_BTFTagAttributed == clang::Type::BTFTagAttributed, "");
static_assert((clang::Type::TypeClass)ZigClangType_BitInt == clang::Type::BitInt, ""); static_assert((clang::Type::TypeClass)ZigClangType_BitInt == clang::Type::BitInt, "");
static_assert((clang::Type::TypeClass)ZigClangType_BlockPointer == clang::Type::BlockPointer, ""); static_assert((clang::Type::TypeClass)ZigClangType_BlockPointer == clang::Type::BlockPointer, "");
static_assert((clang::Type::TypeClass)ZigClangType_Builtin == clang::Type::Builtin, ""); static_assert((clang::Type::TypeClass)ZigClangType_Builtin == clang::Type::Builtin, "");
@ -432,25 +434,33 @@ void ZigClang_detect_enum_StmtClass(clang::Stmt::StmtClass x) {
case clang::Stmt::OMPForDirectiveClass: case clang::Stmt::OMPForDirectiveClass:
case clang::Stmt::OMPForSimdDirectiveClass: case clang::Stmt::OMPForSimdDirectiveClass:
case clang::Stmt::OMPGenericLoopDirectiveClass: case clang::Stmt::OMPGenericLoopDirectiveClass:
case clang::Stmt::OMPMaskedTaskLoopDirectiveClass:
case clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass:
case clang::Stmt::OMPMasterTaskLoopDirectiveClass: case clang::Stmt::OMPMasterTaskLoopDirectiveClass:
case clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass: case clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass:
case clang::Stmt::OMPParallelForDirectiveClass: case clang::Stmt::OMPParallelForDirectiveClass:
case clang::Stmt::OMPParallelForSimdDirectiveClass: case clang::Stmt::OMPParallelForSimdDirectiveClass:
case clang::Stmt::OMPParallelGenericLoopDirectiveClass:
case clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass:
case clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass:
case clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass: case clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass:
case clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass: case clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass:
case clang::Stmt::OMPSimdDirectiveClass: case clang::Stmt::OMPSimdDirectiveClass:
case clang::Stmt::OMPTargetParallelForSimdDirectiveClass: case clang::Stmt::OMPTargetParallelForSimdDirectiveClass:
case clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass:
case clang::Stmt::OMPTargetSimdDirectiveClass: case clang::Stmt::OMPTargetSimdDirectiveClass:
case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass: case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass:
case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass: case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass:
case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass: case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass:
case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass: case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass:
case clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass:
case clang::Stmt::OMPTaskLoopDirectiveClass: case clang::Stmt::OMPTaskLoopDirectiveClass:
case clang::Stmt::OMPTaskLoopSimdDirectiveClass: case clang::Stmt::OMPTaskLoopSimdDirectiveClass:
case clang::Stmt::OMPTeamsDistributeDirectiveClass: case clang::Stmt::OMPTeamsDistributeDirectiveClass:
case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass: case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass:
case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass: case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass:
case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass: case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass:
case clang::Stmt::OMPTeamsGenericLoopDirectiveClass:
case clang::Stmt::OMPTileDirectiveClass: case clang::Stmt::OMPTileDirectiveClass:
case clang::Stmt::OMPUnrollDirectiveClass: case clang::Stmt::OMPUnrollDirectiveClass:
case clang::Stmt::OMPMaskedDirectiveClass: case clang::Stmt::OMPMaskedDirectiveClass:
@ -458,6 +468,7 @@ void ZigClang_detect_enum_StmtClass(clang::Stmt::StmtClass x) {
case clang::Stmt::OMPMetaDirectiveClass: case clang::Stmt::OMPMetaDirectiveClass:
case clang::Stmt::OMPOrderedDirectiveClass: case clang::Stmt::OMPOrderedDirectiveClass:
case clang::Stmt::OMPParallelDirectiveClass: case clang::Stmt::OMPParallelDirectiveClass:
case clang::Stmt::OMPParallelMaskedDirectiveClass:
case clang::Stmt::OMPParallelMasterDirectiveClass: case clang::Stmt::OMPParallelMasterDirectiveClass:
case clang::Stmt::OMPParallelSectionsDirectiveClass: case clang::Stmt::OMPParallelSectionsDirectiveClass:
case clang::Stmt::OMPScanDirectiveClass: case clang::Stmt::OMPScanDirectiveClass:
@ -659,25 +670,33 @@ static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeSimdDirectiveCla
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForDirectiveClass == clang::Stmt::OMPForDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForDirectiveClass == clang::Stmt::OMPForDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForSimdDirectiveClass == clang::Stmt::OMPForSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForSimdDirectiveClass == clang::Stmt::OMPForSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPGenericLoopDirectiveClass == clang::Stmt::OMPGenericLoopDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPGenericLoopDirectiveClass == clang::Stmt::OMPGenericLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopDirectiveClass == clang::Stmt::OMPMaskedTaskLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopDirectiveClass == clang::Stmt::OMPMasterTaskLoopDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopDirectiveClass == clang::Stmt::OMPMasterTaskLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForDirectiveClass == clang::Stmt::OMPParallelForDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForDirectiveClass == clang::Stmt::OMPParallelForDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForSimdDirectiveClass == clang::Stmt::OMPParallelForSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForSimdDirectiveClass == clang::Stmt::OMPParallelForSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelGenericLoopDirectiveClass == clang::Stmt::OMPParallelGenericLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSimdDirectiveClass == clang::Stmt::OMPSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSimdDirectiveClass == clang::Stmt::OMPSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForSimdDirectiveClass == clang::Stmt::OMPTargetParallelForSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForSimdDirectiveClass == clang::Stmt::OMPTargetParallelForSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass == clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetSimdDirectiveClass == clang::Stmt::OMPTargetSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetSimdDirectiveClass == clang::Stmt::OMPTargetSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopDirectiveClass == clang::Stmt::OMPTaskLoopDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopDirectiveClass == clang::Stmt::OMPTaskLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopSimdDirectiveClass == clang::Stmt::OMPTaskLoopSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopSimdDirectiveClass == clang::Stmt::OMPTaskLoopSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeDirectiveClass == clang::Stmt::OMPTeamsDistributeDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeDirectiveClass == clang::Stmt::OMPTeamsDistributeDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeSimdDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeSimdDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTeamsGenericLoopDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTileDirectiveClass == clang::Stmt::OMPTileDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTileDirectiveClass == clang::Stmt::OMPTileDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPUnrollDirectiveClass == clang::Stmt::OMPUnrollDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPUnrollDirectiveClass == clang::Stmt::OMPUnrollDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedDirectiveClass == clang::Stmt::OMPMaskedDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedDirectiveClass == clang::Stmt::OMPMaskedDirectiveClass, "");
@ -685,6 +704,7 @@ static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterDirectiveClass == cl
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMetaDirectiveClass == clang::Stmt::OMPMetaDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMetaDirectiveClass == clang::Stmt::OMPMetaDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPOrderedDirectiveClass == clang::Stmt::OMPOrderedDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPOrderedDirectiveClass == clang::Stmt::OMPOrderedDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelDirectiveClass == clang::Stmt::OMPParallelDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelDirectiveClass == clang::Stmt::OMPParallelDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedDirectiveClass == clang::Stmt::OMPParallelMaskedDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterDirectiveClass == clang::Stmt::OMPParallelMasterDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterDirectiveClass == clang::Stmt::OMPParallelMasterDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelSectionsDirectiveClass == clang::Stmt::OMPParallelSectionsDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelSectionsDirectiveClass == clang::Stmt::OMPParallelSectionsDirectiveClass, "");
static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScanDirectiveClass == clang::Stmt::OMPScanDirectiveClass, ""); static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScanDirectiveClass == clang::Stmt::OMPScanDirectiveClass, "");
@ -958,6 +978,7 @@ void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) {
case clang::Decl::OMPDeclareMapper: case clang::Decl::OMPDeclareMapper:
case clang::Decl::OMPDeclareReduction: case clang::Decl::OMPDeclareReduction:
case clang::Decl::TemplateParamObject: case clang::Decl::TemplateParamObject:
case clang::Decl::UnnamedGlobalConstant:
case clang::Decl::UnresolvedUsingValue: case clang::Decl::UnresolvedUsingValue:
case clang::Decl::OMPAllocate: case clang::Decl::OMPAllocate:
case clang::Decl::OMPRequires: case clang::Decl::OMPRequires:
@ -1046,6 +1067,7 @@ static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, "");
static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, ""); static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, "");
static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, ""); static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, "");
static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, ""); static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, "");
static_assert((clang::Decl::Kind)ZigClangDeclUnnamedGlobalConstant == clang::Decl::UnnamedGlobalConstant, "");
static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, ""); static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, "");
static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, ""); static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, "");
static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, ""); static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, "");
@ -1560,6 +1582,8 @@ void ZigClang_detect_enum_CallingConv(clang::CallingConv x) {
case clang::CC_PreserveMost: case clang::CC_PreserveMost:
case clang::CC_PreserveAll: case clang::CC_PreserveAll:
case clang::CC_AArch64VectorCall: case clang::CC_AArch64VectorCall:
case clang::CC_AArch64SVEPCS:
case clang::CC_AMDGPUKernelCall:
break; break;
} }
} }
@ -1583,6 +1607,8 @@ static_assert((clang::CallingConv)ZigClangCallingConv_SwiftAsync == clang::CC_Sw
static_assert((clang::CallingConv)ZigClangCallingConv_PreserveMost == clang::CC_PreserveMost, ""); static_assert((clang::CallingConv)ZigClangCallingConv_PreserveMost == clang::CC_PreserveMost, "");
static_assert((clang::CallingConv)ZigClangCallingConv_PreserveAll == clang::CC_PreserveAll, ""); static_assert((clang::CallingConv)ZigClangCallingConv_PreserveAll == clang::CC_PreserveAll, "");
static_assert((clang::CallingConv)ZigClangCallingConv_AArch64VectorCall == clang::CC_AArch64VectorCall, ""); static_assert((clang::CallingConv)ZigClangCallingConv_AArch64VectorCall == clang::CC_AArch64VectorCall, "");
static_assert((clang::CallingConv)ZigClangCallingConv_AArch64SVEPCS == clang::CC_AArch64SVEPCS, "");
static_assert((clang::CallingConv)ZigClangCallingConv_AMDGPUKernelCall == clang::CC_AMDGPUKernelCall, "");
void ZigClang_detect_enum_StorageClass(clang::StorageClass x) { void ZigClang_detect_enum_StorageClass(clang::StorageClass x) {
switch (x) { switch (x) {
@ -1623,22 +1649,6 @@ static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_NearestTiesToAway
static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Dynamic == llvm::RoundingMode::Dynamic, ""); static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Dynamic == llvm::RoundingMode::Dynamic, "");
static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Invalid == llvm::RoundingMode::Invalid, ""); static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Invalid == llvm::RoundingMode::Invalid, "");
void ZigClang_detect_enum_StringKind(clang::StringLiteral::StringKind x) {
switch (x) {
case clang::StringLiteral::Ascii:
case clang::StringLiteral::Wide:
case clang::StringLiteral::UTF8:
case clang::StringLiteral::UTF16:
case clang::StringLiteral::UTF32:
break;
}
}
static_assert((clang::StringLiteral::StringKind)ZigClangStringLiteral_StringKind_Ascii == clang::StringLiteral::Ascii, "");
static_assert((clang::StringLiteral::StringKind)ZigClangStringLiteral_StringKind_Wide == clang::StringLiteral::Wide, "");
static_assert((clang::StringLiteral::StringKind)ZigClangStringLiteral_StringKind_UTF8 == clang::StringLiteral::UTF8, "");
static_assert((clang::StringLiteral::StringKind)ZigClangStringLiteral_StringKind_UTF16 == clang::StringLiteral::UTF16, "");
static_assert((clang::StringLiteral::StringKind)ZigClangStringLiteral_StringKind_UTF32 == clang::StringLiteral::UTF32, "");
void ZigClang_detect_enum_CharacterKind(clang::CharacterLiteral::CharacterKind x) { void ZigClang_detect_enum_CharacterKind(clang::CharacterLiteral::CharacterKind x) {
switch (x) { switch (x) {
case clang::CharacterLiteral::Ascii: case clang::CharacterLiteral::Ascii:
@ -2724,9 +2734,9 @@ ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigC
return static_cast<ZigClangAPFloatBase_Semantics>(casted->getRawSemantics()); return static_cast<ZigClangAPFloatBase_Semantics>(casted->getRawSemantics());
} }
enum ZigClangStringLiteral_StringKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) { enum ZigClangCharacterLiteral_CharacterKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) {
auto casted = reinterpret_cast<const clang::StringLiteral *>(self); auto casted = reinterpret_cast<const clang::StringLiteral *>(self);
return (ZigClangStringLiteral_StringKind)casted->getKind(); return (ZigClangCharacterLiteral_CharacterKind)casted->getKind();
} }
uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i) { uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i) {

View File

@ -252,6 +252,7 @@ enum ZigClangTypeClass {
ZigClangType_VariableArray, ZigClangType_VariableArray,
ZigClangType_Atomic, ZigClangType_Atomic,
ZigClangType_Attributed, ZigClangType_Attributed,
ZigClangType_BTFTagAttributed,
ZigClangType_BitInt, ZigClangType_BitInt,
ZigClangType_BlockPointer, ZigClangType_BlockPointer,
ZigClangType_Builtin, ZigClangType_Builtin,
@ -337,25 +338,33 @@ enum ZigClangStmtClass {
ZigClangStmt_OMPForDirectiveClass, ZigClangStmt_OMPForDirectiveClass,
ZigClangStmt_OMPForSimdDirectiveClass, ZigClangStmt_OMPForSimdDirectiveClass,
ZigClangStmt_OMPGenericLoopDirectiveClass, ZigClangStmt_OMPGenericLoopDirectiveClass,
ZigClangStmt_OMPMaskedTaskLoopDirectiveClass,
ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass,
ZigClangStmt_OMPMasterTaskLoopDirectiveClass, ZigClangStmt_OMPMasterTaskLoopDirectiveClass,
ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass, ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass,
ZigClangStmt_OMPParallelForDirectiveClass, ZigClangStmt_OMPParallelForDirectiveClass,
ZigClangStmt_OMPParallelForSimdDirectiveClass, ZigClangStmt_OMPParallelForSimdDirectiveClass,
ZigClangStmt_OMPParallelGenericLoopDirectiveClass,
ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass,
ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass,
ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass, ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass,
ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass, ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass,
ZigClangStmt_OMPSimdDirectiveClass, ZigClangStmt_OMPSimdDirectiveClass,
ZigClangStmt_OMPTargetParallelForSimdDirectiveClass, ZigClangStmt_OMPTargetParallelForSimdDirectiveClass,
ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass,
ZigClangStmt_OMPTargetSimdDirectiveClass, ZigClangStmt_OMPTargetSimdDirectiveClass,
ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass, ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass,
ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass, ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass,
ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass, ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass,
ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass, ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass,
ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass,
ZigClangStmt_OMPTaskLoopDirectiveClass, ZigClangStmt_OMPTaskLoopDirectiveClass,
ZigClangStmt_OMPTaskLoopSimdDirectiveClass, ZigClangStmt_OMPTaskLoopSimdDirectiveClass,
ZigClangStmt_OMPTeamsDistributeDirectiveClass, ZigClangStmt_OMPTeamsDistributeDirectiveClass,
ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass, ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass,
ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass, ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass,
ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass, ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass,
ZigClangStmt_OMPTeamsGenericLoopDirectiveClass,
ZigClangStmt_OMPTileDirectiveClass, ZigClangStmt_OMPTileDirectiveClass,
ZigClangStmt_OMPUnrollDirectiveClass, ZigClangStmt_OMPUnrollDirectiveClass,
ZigClangStmt_OMPMaskedDirectiveClass, ZigClangStmt_OMPMaskedDirectiveClass,
@ -363,6 +372,7 @@ enum ZigClangStmtClass {
ZigClangStmt_OMPMetaDirectiveClass, ZigClangStmt_OMPMetaDirectiveClass,
ZigClangStmt_OMPOrderedDirectiveClass, ZigClangStmt_OMPOrderedDirectiveClass,
ZigClangStmt_OMPParallelDirectiveClass, ZigClangStmt_OMPParallelDirectiveClass,
ZigClangStmt_OMPParallelMaskedDirectiveClass,
ZigClangStmt_OMPParallelMasterDirectiveClass, ZigClangStmt_OMPParallelMasterDirectiveClass,
ZigClangStmt_OMPParallelSectionsDirectiveClass, ZigClangStmt_OMPParallelSectionsDirectiveClass,
ZigClangStmt_OMPScanDirectiveClass, ZigClangStmt_OMPScanDirectiveClass,
@ -667,6 +677,7 @@ enum ZigClangDeclKind {
ZigClangDeclOMPDeclareMapper, ZigClangDeclOMPDeclareMapper,
ZigClangDeclOMPDeclareReduction, ZigClangDeclOMPDeclareReduction,
ZigClangDeclTemplateParamObject, ZigClangDeclTemplateParamObject,
ZigClangDeclUnnamedGlobalConstant,
ZigClangDeclUnresolvedUsingValue, ZigClangDeclUnresolvedUsingValue,
ZigClangDeclOMPAllocate, ZigClangDeclOMPAllocate,
ZigClangDeclOMPRequires, ZigClangDeclOMPRequires,
@ -921,25 +932,27 @@ enum ZigClangBuiltinTypeKind {
}; };
enum ZigClangCallingConv { enum ZigClangCallingConv {
ZigClangCallingConv_C, // __attribute__((cdecl)) ZigClangCallingConv_C,
ZigClangCallingConv_X86StdCall, // __attribute__((stdcall)) ZigClangCallingConv_X86StdCall,
ZigClangCallingConv_X86FastCall, // __attribute__((fastcall)) ZigClangCallingConv_X86FastCall,
ZigClangCallingConv_X86ThisCall, // __attribute__((thiscall)) ZigClangCallingConv_X86ThisCall,
ZigClangCallingConv_X86VectorCall, // __attribute__((vectorcall)) ZigClangCallingConv_X86VectorCall,
ZigClangCallingConv_X86Pascal, // __attribute__((pascal)) ZigClangCallingConv_X86Pascal,
ZigClangCallingConv_Win64, // __attribute__((ms_abi)) ZigClangCallingConv_Win64,
ZigClangCallingConv_X86_64SysV, // __attribute__((sysv_abi)) ZigClangCallingConv_X86_64SysV,
ZigClangCallingConv_X86RegCall, // __attribute__((regcall)) ZigClangCallingConv_X86RegCall,
ZigClangCallingConv_AAPCS, // __attribute__((pcs("aapcs"))) ZigClangCallingConv_AAPCS,
ZigClangCallingConv_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp"))) ZigClangCallingConv_AAPCS_VFP,
ZigClangCallingConv_IntelOclBicc, // __attribute__((intel_ocl_bicc)) ZigClangCallingConv_IntelOclBicc,
ZigClangCallingConv_SpirFunction, // default for OpenCL functions on SPIR target ZigClangCallingConv_SpirFunction,
ZigClangCallingConv_OpenCLKernel, // inferred for OpenCL kernels ZigClangCallingConv_OpenCLKernel,
ZigClangCallingConv_Swift, // __attribute__((swiftcall)) ZigClangCallingConv_Swift,
ZigClangCallingConv_SwiftAsync, // __attribute__((swiftasynccall)) ZigClangCallingConv_SwiftAsync,
ZigClangCallingConv_PreserveMost, // __attribute__((preserve_most)) ZigClangCallingConv_PreserveMost,
ZigClangCallingConv_PreserveAll, // __attribute__((preserve_all)) ZigClangCallingConv_PreserveAll,
ZigClangCallingConv_AArch64VectorCall, // __attribute__((aarch64_vector_pcs)) ZigClangCallingConv_AArch64VectorCall,
ZigClangCallingConv_AArch64SVEPCS,
ZigClangCallingConv_AMDGPUKernelCall,
}; };
enum ZigClangStorageClass { enum ZigClangStorageClass {
@ -1253,7 +1266,6 @@ ZIG_EXTERN_C double ZigClangFloatingLiteral_getValueAsApproximateDouble(const Zi
ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *); ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *);
ZIG_EXTERN_C ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self); ZIG_EXTERN_C ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self);
ZIG_EXTERN_C enum ZigClangStringLiteral_StringKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self);
ZIG_EXTERN_C uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i); ZIG_EXTERN_C uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i);
ZIG_EXTERN_C unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self); ZIG_EXTERN_C unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self);
ZIG_EXTERN_C unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self); ZIG_EXTERN_C unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self);

View File

@ -324,8 +324,10 @@ ZIG_EXTERN_C void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn);
ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv); ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv);
// copied from include/llvm/ADT/Triple.h // synchronize with llvm/include/ADT/Triple.h::ArchType
// synchronize with target.cpp::arch_list // synchronize with std.Target.Cpu.Arch
// synchronize with src/stage1/target.cpp::arch_list
// synchronize with codegen/llvm/bindings.zig::ArchType
enum ZigLLVM_ArchType { enum ZigLLVM_ArchType {
ZigLLVM_UnknownArch, ZigLLVM_UnknownArch,
@ -339,7 +341,10 @@ enum ZigLLVM_ArchType {
ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian) ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian) ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
ZigLLVM_csky, // CSKY: csky ZigLLVM_csky, // CSKY: csky
ZigLLVM_dxil, // DXIL 32-bit DirectX bytecode
ZigLLVM_hexagon, // Hexagon: hexagon ZigLLVM_hexagon, // Hexagon: hexagon
ZigLLVM_loongarch32, // LoongArch (32-bit): loongarch32
ZigLLVM_loongarch64, // LoongArch (64-bit): loongarch64
ZigLLVM_m68k, // M68k: Motorola 680x0 family ZigLLVM_m68k, // M68k: Motorola 680x0 family
ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
@ -409,6 +414,10 @@ enum ZigLLVM_VendorType {
ZigLLVM_LastVendorType = ZigLLVM_OpenEmbedded ZigLLVM_LastVendorType = ZigLLVM_OpenEmbedded
}; };
// synchronize with llvm/include/ADT/Triple.h::OsType
// synchronize with std.Target.Os.Tag
// synchronize with codegen/llvm/bindings.zig::OsType
// synchronize with src/stage1/target.cpp::os_list
enum ZigLLVM_OSType { enum ZigLLVM_OSType {
ZigLLVM_UnknownOS, ZigLLVM_UnknownOS,
@ -437,9 +446,11 @@ enum ZigLLVM_OSType {
ZigLLVM_NVCL, // NVIDIA OpenCL ZigLLVM_NVCL, // NVIDIA OpenCL
ZigLLVM_AMDHSA, // AMD HSA Runtime ZigLLVM_AMDHSA, // AMD HSA Runtime
ZigLLVM_PS4, ZigLLVM_PS4,
ZigLLVM_PS5,
ZigLLVM_ELFIAMCU, ZigLLVM_ELFIAMCU,
ZigLLVM_TvOS, // Apple tvOS ZigLLVM_TvOS, // Apple tvOS
ZigLLVM_WatchOS, // Apple watchOS ZigLLVM_WatchOS, // Apple watchOS
ZigLLVM_DriverKit, // Apple DriverKit
ZigLLVM_Mesa3D, ZigLLVM_Mesa3D,
ZigLLVM_Contiki, ZigLLVM_Contiki,
ZigLLVM_AMDPAL, // AMD PAL Runtime ZigLLVM_AMDPAL, // AMD PAL Runtime
@ -447,8 +458,8 @@ enum ZigLLVM_OSType {
ZigLLVM_Hurd, // GNU/Hurd ZigLLVM_Hurd, // GNU/Hurd
ZigLLVM_WASI, // Experimental WebAssembly OS ZigLLVM_WASI, // Experimental WebAssembly OS
ZigLLVM_Emscripten, ZigLLVM_Emscripten,
ZigLLVM_ShaderModel, // DirectX ShaderModel
ZigLLVM_LastOSType = ZigLLVM_Emscripten ZigLLVM_LastOSType = ZigLLVM_ShaderModel
}; };
// Synchronize with target.cpp::abi_list // Synchronize with target.cpp::abi_list
@ -477,16 +488,35 @@ enum ZigLLVM_EnvironmentType {
ZigLLVM_CoreCLR, ZigLLVM_CoreCLR,
ZigLLVM_Simulator, // Simulator variants of other systems, e.g., Apple's iOS ZigLLVM_Simulator, // Simulator variants of other systems, e.g., Apple's iOS
ZigLLVM_MacABI, // Mac Catalyst variant of Apple's iOS deployment target. ZigLLVM_MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
ZigLLVM_LastEnvironmentType = ZigLLVM_MacABI
ZigLLVM_Pixel,
ZigLLVM_Vertex,
ZigLLVM_Geometry,
ZigLLVM_Hull,
ZigLLVM_Domain,
ZigLLVM_Compute,
ZigLLVM_Library,
ZigLLVM_RayGeneration,
ZigLLVM_Intersection,
ZigLLVM_AnyHit,
ZigLLVM_ClosestHit,
ZigLLVM_Miss,
ZigLLVM_Callable,
ZigLLVM_Mesh,
ZigLLVM_Amplification,
ZigLLVM_LastEnvironmentType = ZigLLVM_Amplification
}; };
enum ZigLLVM_ObjectFormatType { enum ZigLLVM_ObjectFormatType {
ZigLLVM_UnknownObjectFormat, ZigLLVM_UnknownObjectFormat,
ZigLLVM_COFF, ZigLLVM_COFF,
ZigLLVM_DXContainer,
ZigLLVM_ELF, ZigLLVM_ELF,
ZigLLVM_GOFF, ZigLLVM_GOFF,
ZigLLVM_MachO, ZigLLVM_MachO,
ZigLLVM_SPIRV,
ZigLLVM_Wasm, ZigLLVM_Wasm,
ZigLLVM_XCOFF, ZigLLVM_XCOFF,
}; };