mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Update zig_llvm.cpp and other bits
Include updates to corresponding zig sources llvm commit b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6
This commit is contained in:
parent
6f3ed2f71f
commit
1c40a4df09
@ -36,11 +36,11 @@ pub const Target = struct {
|
||||
openbsd,
|
||||
solaris,
|
||||
windows,
|
||||
zos,
|
||||
haiku,
|
||||
minix,
|
||||
rtems,
|
||||
nacl,
|
||||
cnk,
|
||||
aix,
|
||||
cuda,
|
||||
nvcl,
|
||||
@ -206,11 +206,11 @@ pub const Target = struct {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
@ -358,11 +358,11 @@ pub const Target = struct {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
@ -432,11 +432,11 @@ pub const Target = struct {
|
||||
.dragonfly,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
@ -673,6 +673,7 @@ pub const Target = struct {
|
||||
avr,
|
||||
bpfel,
|
||||
bpfeb,
|
||||
csky,
|
||||
hexagon,
|
||||
mips,
|
||||
mipsel,
|
||||
@ -827,6 +828,7 @@ pub const Target = struct {
|
||||
.amdgcn => ._NONE,
|
||||
.bpfel => ._BPF,
|
||||
.bpfeb => ._BPF,
|
||||
.csky => ._CSKY,
|
||||
.sparcv9 => ._SPARCV9,
|
||||
.s390x => ._S390,
|
||||
.ve => ._NONE,
|
||||
@ -884,6 +886,7 @@ pub const Target = struct {
|
||||
.amdgcn => .Unknown,
|
||||
.bpfel => .Unknown,
|
||||
.bpfeb => .Unknown,
|
||||
.csky => .Unknown,
|
||||
.sparcv9 => .Unknown,
|
||||
.s390x => .Unknown,
|
||||
.ve => .Unknown,
|
||||
@ -901,6 +904,7 @@ pub const Target = struct {
|
||||
.amdil,
|
||||
.amdil64,
|
||||
.bpfel,
|
||||
.csky,
|
||||
.hexagon,
|
||||
.hsail,
|
||||
.hsail64,
|
||||
@ -961,6 +965,7 @@ pub const Target = struct {
|
||||
.arc,
|
||||
.arm,
|
||||
.armeb,
|
||||
.csky,
|
||||
.hexagon,
|
||||
.le32,
|
||||
.mips,
|
||||
@ -1020,6 +1025,7 @@ pub const Target = struct {
|
||||
.aarch64, .aarch64_be, .aarch64_32 => "aarch64",
|
||||
.avr => "avr",
|
||||
.bpfel, .bpfeb => "bpf",
|
||||
.csky => "csky",
|
||||
.hexagon => "hexagon",
|
||||
.mips, .mipsel, .mips64, .mips64el => "mips",
|
||||
.msp430 => "msp430",
|
||||
@ -1461,6 +1467,7 @@ pub const Target = struct {
|
||||
// TODO go over each item in this list and either move it to the above list, or
|
||||
// implement the standard dynamic linker path code for it.
|
||||
.arc,
|
||||
.csky,
|
||||
.hexagon,
|
||||
.msp430,
|
||||
.r600,
|
||||
@ -1509,11 +1516,11 @@ pub const Target = struct {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
|
||||
@ -111,11 +111,11 @@ pub const CrossTarget = struct {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
@ -711,11 +711,11 @@ pub const CrossTarget = struct {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
|
||||
@ -12,6 +12,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![]u8 {
|
||||
.avr => "avr",
|
||||
.bpfel => "bpfel",
|
||||
.bpfeb => "bpfeb",
|
||||
.csky => "csky",
|
||||
.hexagon => "hexagon",
|
||||
.mips => "mips",
|
||||
.mipsel => "mipsel",
|
||||
@ -74,11 +75,11 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![]u8 {
|
||||
.openbsd => "openbsd",
|
||||
.solaris => "solaris",
|
||||
.windows => "windows",
|
||||
.zos => "zos",
|
||||
.haiku => "haiku",
|
||||
.minix => "minix",
|
||||
.rtems => "rtems",
|
||||
.nacl => "nacl",
|
||||
.cnk => "cnk",
|
||||
.aix => "aix",
|
||||
.cuda => "cuda",
|
||||
.nvcl => "nvcl",
|
||||
|
||||
96
src/llvm.zig
96
src/llvm.zig
@ -15,6 +15,7 @@ pub const ObjectFormatType = extern enum(c_int) {
|
||||
Unknown,
|
||||
COFF,
|
||||
ELF,
|
||||
GOFF,
|
||||
MachO,
|
||||
Wasm,
|
||||
XCOFF,
|
||||
@ -51,11 +52,11 @@ pub const OSType = extern enum(c_int) {
|
||||
OpenBSD = 13,
|
||||
Solaris = 14,
|
||||
Win32 = 15,
|
||||
Haiku = 16,
|
||||
Minix = 17,
|
||||
RTEMS = 18,
|
||||
NaCl = 19,
|
||||
CNK = 20,
|
||||
ZOS = 16,
|
||||
Haiku = 17,
|
||||
Minix = 18,
|
||||
RTEMS = 19,
|
||||
NaCl = 20,
|
||||
AIX = 21,
|
||||
CUDA = 22,
|
||||
NVCL = 23,
|
||||
@ -84,48 +85,49 @@ pub const ArchType = extern enum(c_int) {
|
||||
avr = 7,
|
||||
bpfel = 8,
|
||||
bpfeb = 9,
|
||||
hexagon = 10,
|
||||
mips = 11,
|
||||
mipsel = 12,
|
||||
mips64 = 13,
|
||||
mips64el = 14,
|
||||
msp430 = 15,
|
||||
ppc = 16,
|
||||
ppc64 = 17,
|
||||
ppc64le = 18,
|
||||
r600 = 19,
|
||||
amdgcn = 20,
|
||||
riscv32 = 21,
|
||||
riscv64 = 22,
|
||||
sparc = 23,
|
||||
sparcv9 = 24,
|
||||
sparcel = 25,
|
||||
systemz = 26,
|
||||
tce = 27,
|
||||
tcele = 28,
|
||||
thumb = 29,
|
||||
thumbeb = 30,
|
||||
x86 = 31,
|
||||
x86_64 = 32,
|
||||
xcore = 33,
|
||||
nvptx = 34,
|
||||
nvptx64 = 35,
|
||||
le32 = 36,
|
||||
le64 = 37,
|
||||
amdil = 38,
|
||||
amdil64 = 39,
|
||||
hsail = 40,
|
||||
hsail64 = 41,
|
||||
spir = 42,
|
||||
spir64 = 43,
|
||||
kalimba = 44,
|
||||
shave = 45,
|
||||
lanai = 46,
|
||||
wasm32 = 47,
|
||||
wasm64 = 48,
|
||||
renderscript32 = 49,
|
||||
renderscript64 = 50,
|
||||
ve = 51,
|
||||
csky = 10,
|
||||
hexagon = 11,
|
||||
mips = 12,
|
||||
mipsel = 13,
|
||||
mips64 = 14,
|
||||
mips64el = 15,
|
||||
msp430 = 16,
|
||||
ppc = 17,
|
||||
ppc64 = 18,
|
||||
ppc64le = 19,
|
||||
r600 = 20,
|
||||
amdgcn = 21,
|
||||
riscv32 = 22,
|
||||
riscv64 = 23,
|
||||
sparc = 24,
|
||||
sparcv9 = 25,
|
||||
sparcel = 26,
|
||||
systemz = 27,
|
||||
tce = 28,
|
||||
tcele = 29,
|
||||
thumb = 30,
|
||||
thumbeb = 31,
|
||||
x86 = 32,
|
||||
x86_64 = 33,
|
||||
xcore = 34,
|
||||
nvptx = 35,
|
||||
nvptx64 = 36,
|
||||
le32 = 37,
|
||||
le64 = 38,
|
||||
amdil = 39,
|
||||
amdil64 = 40,
|
||||
hsail = 41,
|
||||
hsail64 = 42,
|
||||
spir = 43,
|
||||
spir64 = 44,
|
||||
kalimba = 45,
|
||||
shave = 46,
|
||||
lanai = 47,
|
||||
wasm32 = 48,
|
||||
wasm64 = 49,
|
||||
renderscript32 = 50,
|
||||
renderscript64 = 51,
|
||||
ve = 52,
|
||||
};
|
||||
|
||||
pub const ParseCommandLineOptions = ZigLLVMParseCommandLineOptions;
|
||||
|
||||
@ -73,11 +73,11 @@ enum Os {
|
||||
OsOpenBSD,
|
||||
OsSolaris,
|
||||
OsWindows,
|
||||
OsZOS,
|
||||
OsHaiku,
|
||||
OsMinix,
|
||||
OsRTEMS,
|
||||
OsNaCl, // Native Client
|
||||
OsCNK, // BG/P Compute-Node Kernel
|
||||
OsAIX,
|
||||
OsCUDA, // NVIDIA CUDA
|
||||
OsNVCL, // NVIDIA OpenCL
|
||||
|
||||
@ -23,6 +23,7 @@ static const ZigLLVM_ArchType arch_list[] = {
|
||||
ZigLLVM_avr, // AVR: Atmel AVR microcontroller
|
||||
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_csky, // CSKY: csky
|
||||
ZigLLVM_hexagon, // Hexagon: hexagon
|
||||
ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
|
||||
ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
|
||||
@ -71,8 +72,6 @@ static const ZigLLVM_VendorType vendor_list[] = {
|
||||
ZigLLVM_Apple,
|
||||
ZigLLVM_PC,
|
||||
ZigLLVM_SCEI,
|
||||
ZigLLVM_BGP,
|
||||
ZigLLVM_BGQ,
|
||||
ZigLLVM_Freescale,
|
||||
ZigLLVM_IBM,
|
||||
ZigLLVM_ImaginationTechnologies,
|
||||
@ -101,11 +100,11 @@ static const Os os_list[] = {
|
||||
OsOpenBSD,
|
||||
OsSolaris,
|
||||
OsWindows,
|
||||
OsZOS,
|
||||
OsHaiku,
|
||||
OsMinix,
|
||||
OsRTEMS,
|
||||
OsNaCl, // Native Client
|
||||
OsCNK, // BG/P Compute-Node Kernel
|
||||
OsAIX,
|
||||
OsCUDA, // NVIDIA CUDA
|
||||
OsNVCL, // NVIDIA OpenCL
|
||||
@ -155,8 +154,10 @@ static const ZigLLVM_ObjectFormatType oformat_list[] = {
|
||||
ZigLLVM_UnknownObjectFormat,
|
||||
ZigLLVM_COFF,
|
||||
ZigLLVM_ELF,
|
||||
ZigLLVM_GOFF,
|
||||
ZigLLVM_MachO,
|
||||
ZigLLVM_Wasm,
|
||||
ZigLLVM_XCOFF,
|
||||
};
|
||||
|
||||
size_t target_oformat_count(void) {
|
||||
@ -173,6 +174,7 @@ const char *target_oformat_name(ZigLLVM_ObjectFormatType oformat) {
|
||||
case ZigLLVM_UnknownObjectFormat: return "unknown";
|
||||
case ZigLLVM_COFF: return "coff";
|
||||
case ZigLLVM_ELF: return "elf";
|
||||
case ZigLLVM_GOFF: return "goff";
|
||||
case ZigLLVM_MachO: return "macho";
|
||||
case ZigLLVM_Wasm: return "wasm";
|
||||
case ZigLLVM_XCOFF: return "xcoff";
|
||||
@ -240,6 +242,8 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
|
||||
case OsWindows:
|
||||
case OsUefi:
|
||||
return ZigLLVM_Win32;
|
||||
case OsZOS:
|
||||
return ZigLLVM_ZOS;
|
||||
case OsHaiku:
|
||||
return ZigLLVM_Haiku;
|
||||
case OsMinix:
|
||||
@ -248,8 +252,6 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
|
||||
return ZigLLVM_RTEMS;
|
||||
case OsNaCl:
|
||||
return ZigLLVM_NaCl;
|
||||
case OsCNK:
|
||||
return ZigLLVM_CNK;
|
||||
case OsAIX:
|
||||
return ZigLLVM_AIX;
|
||||
case OsCUDA:
|
||||
@ -306,11 +308,11 @@ const char *target_os_name(Os os_type) {
|
||||
case OsOpenBSD:
|
||||
case OsSolaris:
|
||||
case OsWindows:
|
||||
case OsZOS:
|
||||
case OsHaiku:
|
||||
case OsMinix:
|
||||
case OsRTEMS:
|
||||
case OsNaCl: // Native Client
|
||||
case OsCNK: // BG/P Compute-Node Kernel
|
||||
case OsAIX:
|
||||
case OsCUDA: // NVIDIA CUDA
|
||||
case OsNVCL: // NVIDIA OpenCL
|
||||
@ -501,6 +503,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
|
||||
case ZigLLVM_wasm32:
|
||||
case ZigLLVM_renderscript32:
|
||||
case ZigLLVM_aarch64_32:
|
||||
case ZigLLVM_csky:
|
||||
return 32;
|
||||
|
||||
case ZigLLVM_aarch64:
|
||||
@ -565,6 +568,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
|
||||
case ZigLLVM_shave:
|
||||
case ZigLLVM_wasm32:
|
||||
case ZigLLVM_renderscript32:
|
||||
case ZigLLVM_csky:
|
||||
return 32;
|
||||
|
||||
case ZigLLVM_aarch64:
|
||||
@ -703,11 +707,11 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
|
||||
case OsKFreeBSD:
|
||||
case OsLv2:
|
||||
case OsSolaris:
|
||||
case OsZOS:
|
||||
case OsHaiku:
|
||||
case OsMinix:
|
||||
case OsRTEMS:
|
||||
case OsNaCl:
|
||||
case OsCNK:
|
||||
case OsAIX:
|
||||
case OsCUDA:
|
||||
case OsNVCL:
|
||||
@ -811,6 +815,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
|
||||
case ZigLLVM_avr:
|
||||
case ZigLLVM_bpfeb:
|
||||
case ZigLLVM_bpfel:
|
||||
case ZigLLVM_csky:
|
||||
case ZigLLVM_hexagon:
|
||||
case ZigLLVM_lanai:
|
||||
case ZigLLVM_hsail:
|
||||
@ -865,6 +870,7 @@ bool target_is_arm(const ZigTarget *target) {
|
||||
case ZigLLVM_avr:
|
||||
case ZigLLVM_bpfeb:
|
||||
case ZigLLVM_bpfel:
|
||||
case ZigLLVM_csky:
|
||||
case ZigLLVM_hexagon:
|
||||
case ZigLLVM_lanai:
|
||||
case ZigLLVM_hsail:
|
||||
@ -948,11 +954,11 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
|
||||
case OsCloudABI:
|
||||
case OsLv2:
|
||||
case OsSolaris:
|
||||
case OsZOS:
|
||||
case OsHaiku:
|
||||
case OsMinix:
|
||||
case OsRTEMS:
|
||||
case OsNaCl:
|
||||
case OsCNK:
|
||||
case OsAIX:
|
||||
case OsCUDA:
|
||||
case OsNVCL:
|
||||
|
||||
@ -94,6 +94,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
|
||||
return OsSolaris;
|
||||
case ZigLLVM_Win32:
|
||||
return OsWindows;
|
||||
case ZigLLVM_ZOS:
|
||||
return OsZOS;
|
||||
case ZigLLVM_Haiku:
|
||||
return OsHaiku;
|
||||
case ZigLLVM_Minix:
|
||||
@ -102,8 +104,6 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
|
||||
return OsRTEMS;
|
||||
case ZigLLVM_NaCl:
|
||||
return OsNaCl;
|
||||
case ZigLLVM_CNK:
|
||||
return OsCNK;
|
||||
case ZigLLVM_AIX:
|
||||
return OsAIX;
|
||||
case ZigLLVM_CUDA:
|
||||
|
||||
@ -206,11 +206,11 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
|
||||
.netbsd => .NetBSD,
|
||||
.openbsd => .OpenBSD,
|
||||
.solaris => .Solaris,
|
||||
.zos => .ZOS,
|
||||
.haiku => .Haiku,
|
||||
.minix => .Minix,
|
||||
.rtems => .RTEMS,
|
||||
.nacl => .NaCl,
|
||||
.cnk => .CNK,
|
||||
.aix => .AIX,
|
||||
.cuda => .CUDA,
|
||||
.nvcl => .NVCL,
|
||||
|
||||
@ -3236,11 +3236,11 @@ pub const CType = enum {
|
||||
.kfreebsd,
|
||||
.lv2,
|
||||
.solaris,
|
||||
.zos,
|
||||
.haiku,
|
||||
.minix,
|
||||
.rtems,
|
||||
.nacl,
|
||||
.cnk,
|
||||
.aix,
|
||||
.cuda,
|
||||
.nvcl,
|
||||
|
||||
@ -182,6 +182,8 @@ void ZigClang_detect_enum_CK(clang::CastKind x) {
|
||||
case clang::CK_IntegralToBoolean:
|
||||
case clang::CK_IntegralToFloating:
|
||||
case clang::CK_IntegralToPointer:
|
||||
case clang::CK_FloatingToFixedPoint:
|
||||
case clang::CK_FixedPointToFloating:
|
||||
case clang::CK_LValueBitCast:
|
||||
case clang::CK_LValueToRValueBitCast:
|
||||
case clang::CK_LValueToRValue:
|
||||
@ -237,6 +239,8 @@ static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat,
|
||||
static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_IntegralToFloating == clang::CK_IntegralToFloating, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_FloatingToFixedPoint == clang::CK_FloatingToFixedPoint, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_FixedPointToFloating == clang::CK_FixedPointToFloating, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, "");
|
||||
static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, "");
|
||||
@ -928,6 +932,7 @@ void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) {
|
||||
case clang::Decl::MSGuid:
|
||||
case clang::Decl::OMPDeclareMapper:
|
||||
case clang::Decl::OMPDeclareReduction:
|
||||
case clang::Decl::TemplateParamObject:
|
||||
case clang::Decl::UnresolvedUsingValue:
|
||||
case clang::Decl::OMPAllocate:
|
||||
case clang::Decl::OMPRequires:
|
||||
@ -1013,6 +1018,7 @@ static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::Indir
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, "");
|
||||
static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, "");
|
||||
@ -1122,6 +1128,8 @@ void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) {
|
||||
case clang::BuiltinType::SveFloat64x4:
|
||||
case clang::BuiltinType::SveBFloat16x4:
|
||||
case clang::BuiltinType::SveBool:
|
||||
case clang::BuiltinType::VectorQuad:
|
||||
case clang::BuiltinType::VectorPair:
|
||||
case clang::BuiltinType::Void:
|
||||
case clang::BuiltinType::Bool:
|
||||
case clang::BuiltinType::Char_U:
|
||||
@ -1295,6 +1303,8 @@ static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBool == clang::BuiltinType::SveBool, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorQuad == clang::BuiltinType::VectorQuad, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorPair == clang::BuiltinType::VectorPair, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, "");
|
||||
static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, "");
|
||||
@ -1517,15 +1527,19 @@ static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_
|
||||
static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InclusionDirectiveKind == clang::PreprocessedEntity::InclusionDirectiveKind, "");
|
||||
|
||||
|
||||
void ZigClang_detect_enum_ConstExprUsage(clang::Expr::ConstExprUsage x) {
|
||||
void ZigClang_detect_enum_ConstantExprKind(clang::Expr::ConstantExprKind x) {
|
||||
switch (x) {
|
||||
case clang::Expr::EvaluateForCodeGen:
|
||||
case clang::Expr::EvaluateForMangling:
|
||||
case clang::Expr::ConstantExprKind::Normal:
|
||||
case clang::Expr::ConstantExprKind::NonClassTemplateArgument:
|
||||
case clang::Expr::ConstantExprKind::ClassTemplateArgument:
|
||||
case clang::Expr::ConstantExprKind::ImmediateInvocation:
|
||||
break;
|
||||
}
|
||||
}
|
||||
static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForCodeGen == clang::Expr::EvaluateForCodeGen, "");
|
||||
static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForMangling == clang::Expr::EvaluateForMangling, "");
|
||||
static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, "");
|
||||
static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, "");
|
||||
static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, "");
|
||||
static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, "");
|
||||
|
||||
|
||||
static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "");
|
||||
@ -2143,12 +2157,12 @@ bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **re
|
||||
}
|
||||
|
||||
bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result,
|
||||
ZigClangExpr_ConstExprUsage usage, const struct ZigClangASTContext *ctx)
|
||||
ZigClangExpr_ConstantExprKind kind, const struct ZigClangASTContext *ctx)
|
||||
{
|
||||
auto casted_self = reinterpret_cast<const clang::Expr *>(self);
|
||||
auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx);
|
||||
clang::Expr::EvalResult eval_result;
|
||||
if (!casted_self->EvaluateAsConstantExpr(eval_result, (clang::Expr::ConstExprUsage)usage, *casted_ctx)) {
|
||||
if (!casted_self->EvaluateAsConstantExpr(eval_result, *casted_ctx, (clang::Expr::ConstantExprKind)kind)) {
|
||||
return false;
|
||||
}
|
||||
*result = bitcast(eval_result);
|
||||
|
||||
@ -523,6 +523,8 @@ enum ZigClangCK {
|
||||
ZigClangCK_IntegralCast,
|
||||
ZigClangCK_IntegralToBoolean,
|
||||
ZigClangCK_IntegralToFloating,
|
||||
ZigClangCK_FloatingToFixedPoint,
|
||||
ZigClangCK_FixedPointToFloating,
|
||||
ZigClangCK_FixedPointCast,
|
||||
ZigClangCK_FixedPointToIntegral,
|
||||
ZigClangCK_IntegralToFixedPoint,
|
||||
@ -629,6 +631,7 @@ enum ZigClangDeclKind {
|
||||
ZigClangDeclMSGuid,
|
||||
ZigClangDeclOMPDeclareMapper,
|
||||
ZigClangDeclOMPDeclareReduction,
|
||||
ZigClangDeclTemplateParamObject,
|
||||
ZigClangDeclUnresolvedUsingValue,
|
||||
ZigClangDeclOMPAllocate,
|
||||
ZigClangDeclOMPRequires,
|
||||
@ -739,6 +742,8 @@ enum ZigClangBuiltinTypeKind {
|
||||
ZigClangBuiltinTypeSveFloat64x4,
|
||||
ZigClangBuiltinTypeSveBFloat16x4,
|
||||
ZigClangBuiltinTypeSveBool,
|
||||
ZigClangBuiltinTypeVectorQuad,
|
||||
ZigClangBuiltinTypeVectorPair,
|
||||
ZigClangBuiltinTypeVoid,
|
||||
ZigClangBuiltinTypeBool,
|
||||
ZigClangBuiltinTypeChar_U,
|
||||
@ -897,9 +902,11 @@ enum ZigClangPreprocessedEntity_EntityKind {
|
||||
ZigClangPreprocessedEntity_InclusionDirectiveKind,
|
||||
};
|
||||
|
||||
enum ZigClangExpr_ConstExprUsage {
|
||||
ZigClangExpr_EvaluateForCodeGen,
|
||||
ZigClangExpr_EvaluateForMangling,
|
||||
enum ZigClangExpr_ConstantExprKind {
|
||||
ZigClangExpr_ContantExprKind_Normal,
|
||||
ZigClangExpr_ContantExprKind_NonClassTemplateArgument,
|
||||
ZigClangExpr_ContantExprKind_ClassTemplateArgument,
|
||||
ZigClangExpr_ContantExprKind_ImmediateInvocation,
|
||||
};
|
||||
|
||||
enum ZigClangUnaryExprOrTypeTrait_Kind {
|
||||
@ -1058,7 +1065,7 @@ ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangE
|
||||
ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self,
|
||||
ZigClangAPFloat **result, const struct ZigClangASTContext *ctx);
|
||||
ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsConstantExpr(const struct ZigClangExpr *,
|
||||
struct ZigClangExprEvalResult *, ZigClangExpr_ConstExprUsage, const struct ZigClangASTContext *);
|
||||
struct ZigClangExprEvalResult *, ZigClangExpr_ConstantExprKind, const struct ZigClangASTContext *);
|
||||
|
||||
ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned);
|
||||
ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *);
|
||||
|
||||
@ -600,8 +600,9 @@ void ZigLLVMDisposeDIBuilder(ZigLLVMDIBuilder *dbuilder) {
|
||||
}
|
||||
|
||||
void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope) {
|
||||
unwrap(builder)->SetCurrentDebugLocation(DebugLoc::get(
|
||||
line, column, reinterpret_cast<DIScope*>(scope)));
|
||||
DIScope* di_scope = reinterpret_cast<DIScope*>(scope);
|
||||
DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, column, di_scope, nullptr, false);
|
||||
unwrap(builder)->SetCurrentDebugLocation(debug_loc);
|
||||
}
|
||||
|
||||
void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) {
|
||||
@ -762,7 +763,8 @@ LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef stor
|
||||
}
|
||||
|
||||
ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScope *scope) {
|
||||
DebugLoc debug_loc = DebugLoc::get(line, col, reinterpret_cast<DIScope*>(scope), nullptr);
|
||||
DIScope* di_scope = reinterpret_cast<DIScope*>(scope);
|
||||
DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, col, di_scope, nullptr, false);
|
||||
return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get());
|
||||
}
|
||||
|
||||
@ -1180,6 +1182,7 @@ static_assert((Triple::ArchType)ZigLLVM_arc == Triple::arc, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_avr == Triple::avr, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_bpfel == Triple::bpfel, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_bpfeb == Triple::bpfeb, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_csky == Triple::csky, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_hexagon == Triple::hexagon, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_mips == Triple::mips, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_mipsel == Triple::mipsel, "");
|
||||
@ -1228,8 +1231,6 @@ static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor
|
||||
static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_SCEI == Triple::SCEI, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_BGP == Triple::BGP, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_BGQ == Triple::BGQ, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_Freescale == Triple::Freescale, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_IBM == Triple::IBM, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_ImaginationTechnologies == Triple::ImaginationTechnologies, "");
|
||||
@ -1261,11 +1262,11 @@ static_assert((Triple::OSType)ZigLLVM_NetBSD == Triple::NetBSD, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_OpenBSD == Triple::OpenBSD, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_Solaris == Triple::Solaris, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_Win32 == Triple::Win32, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_ZOS == Triple::ZOS, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_Haiku == Triple::Haiku, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_Minix == Triple::Minix, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_RTEMS == Triple::RTEMS, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_NaCl == Triple::NaCl, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_CNK == Triple::CNK, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_AIX == Triple::AIX, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_CUDA == Triple::CUDA, "");
|
||||
static_assert((Triple::OSType)ZigLLVM_NVCL == Triple::NVCL, "");
|
||||
@ -1308,6 +1309,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_LastEnvironmentType == Triple::La
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_UnknownObjectFormat == Triple::UnknownObjectFormat, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_COFF == Triple::COFF, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_ELF == Triple::ELF, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_GOFF == Triple::GOFF, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_MachO == Triple::MachO, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_Wasm == Triple::Wasm, "");
|
||||
static_assert((Triple::ObjectFormatType)ZigLLVM_XCOFF == Triple::XCOFF, "");
|
||||
|
||||
@ -288,6 +288,7 @@ enum ZigLLVM_ArchType {
|
||||
ZigLLVM_avr, // AVR: Atmel AVR microcontroller
|
||||
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_csky, // CSKY: csky
|
||||
ZigLLVM_hexagon, // Hexagon: hexagon
|
||||
ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
|
||||
ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
|
||||
@ -340,8 +341,6 @@ enum ZigLLVM_VendorType {
|
||||
ZigLLVM_Apple,
|
||||
ZigLLVM_PC,
|
||||
ZigLLVM_SCEI,
|
||||
ZigLLVM_BGP,
|
||||
ZigLLVM_BGQ,
|
||||
ZigLLVM_Freescale,
|
||||
ZigLLVM_IBM,
|
||||
ZigLLVM_ImaginationTechnologies,
|
||||
@ -375,11 +374,11 @@ enum ZigLLVM_OSType {
|
||||
ZigLLVM_OpenBSD,
|
||||
ZigLLVM_Solaris,
|
||||
ZigLLVM_Win32,
|
||||
ZigLLVM_ZOS,
|
||||
ZigLLVM_Haiku,
|
||||
ZigLLVM_Minix,
|
||||
ZigLLVM_RTEMS,
|
||||
ZigLLVM_NaCl, // Native Client
|
||||
ZigLLVM_CNK, // BG/P Compute-Node Kernel
|
||||
ZigLLVM_AIX,
|
||||
ZigLLVM_CUDA, // NVIDIA CUDA
|
||||
ZigLLVM_NVCL, // NVIDIA OpenCL
|
||||
@ -432,6 +431,7 @@ enum ZigLLVM_ObjectFormatType {
|
||||
|
||||
ZigLLVM_COFF,
|
||||
ZigLLVM_ELF,
|
||||
ZigLLVM_GOFF,
|
||||
ZigLLVM_MachO,
|
||||
ZigLLVM_Wasm,
|
||||
ZigLLVM_XCOFF,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user