remove sub-arch from stage1
parent
ab56d3e18c
commit
61c67a9833
|
@ -909,12 +909,11 @@ export fn stage2_libc_render(stage1_libc: *Stage2LibCInstallation, output_file:
|
|||
// ABI warning
|
||||
const Stage2Target = extern struct {
|
||||
arch: c_int,
|
||||
sub_arch: c_int,
|
||||
|
||||
vendor: c_int,
|
||||
abi: c_int,
|
||||
|
||||
abi: c_int,
|
||||
os: c_int,
|
||||
|
||||
is_native: bool,
|
||||
|
||||
glibc_version: ?*Stage2GLibCVersion, // null means default
|
||||
|
@ -928,7 +927,6 @@ const Stage2Target = extern struct {
|
|||
if (in_target.is_native) return .Native;
|
||||
|
||||
const in_arch = in_target.arch - 1; // skip over ZigLLVM_UnknownArch
|
||||
const in_sub_arch = in_target.sub_arch - 1; // skip over ZigLLVM_NoSubArch
|
||||
const in_os = in_target.os;
|
||||
const in_abi = in_target.abi;
|
||||
|
||||
|
@ -954,7 +952,6 @@ const Stage2Target = extern struct {
|
|||
};
|
||||
self.* = .{
|
||||
.arch = @enumToInt(target.getArch()) + 1, // skip over ZigLLVM_UnknownArch
|
||||
.sub_arch = 0,
|
||||
.vendor = 0,
|
||||
.os = @enumToInt(target.getOs()),
|
||||
.abi = @enumToInt(target.getAbi()),
|
||||
|
|
|
@ -8711,7 +8711,6 @@ static Error define_builtin_compile_vars(CodeGen *g) {
|
|||
cache_int(&cache_hash, g->code_model);
|
||||
cache_int(&cache_hash, g->zig_target->is_native);
|
||||
cache_int(&cache_hash, g->zig_target->arch);
|
||||
cache_int(&cache_hash, g->zig_target->sub_arch);
|
||||
cache_int(&cache_hash, g->zig_target->vendor);
|
||||
cache_int(&cache_hash, g->zig_target->os);
|
||||
cache_int(&cache_hash, g->zig_target->abi);
|
||||
|
@ -9616,7 +9615,6 @@ Error create_c_object_cache(CodeGen *g, CacheHash **out_cache_hash, bool verbose
|
|||
cache_list_of_str(cache_hash, g->libc_include_dir_list, g->libc_include_dir_len);
|
||||
cache_int(cache_hash, g->zig_target->is_native);
|
||||
cache_int(cache_hash, g->zig_target->arch);
|
||||
cache_int(cache_hash, g->zig_target->sub_arch);
|
||||
cache_int(cache_hash, g->zig_target->vendor);
|
||||
cache_int(cache_hash, g->zig_target->os);
|
||||
cache_int(cache_hash, g->zig_target->abi);
|
||||
|
@ -10380,7 +10378,6 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {
|
|||
cache_int(ch, g->out_type);
|
||||
cache_bool(ch, g->zig_target->is_native);
|
||||
cache_int(ch, g->zig_target->arch);
|
||||
cache_int(ch, g->zig_target->sub_arch);
|
||||
cache_int(ch, g->zig_target->vendor);
|
||||
cache_int(ch, g->zig_target->os);
|
||||
cache_int(ch, g->zig_target->abi);
|
||||
|
|
|
@ -116,10 +116,8 @@ Error glibc_load_metadata(ZigGLibCAbi **out_result, Buf *zig_lib_dir, bool verbo
|
|||
assert(opt_abi.is_some);
|
||||
|
||||
|
||||
err = target_parse_archsub(&target->arch, &target->sub_arch,
|
||||
(char*)opt_arch.value.ptr, opt_arch.value.len);
|
||||
// there's no sub arch so we might get an error, but the arch is still populated
|
||||
assert(err == ErrorNone || err == ErrorUnknownArchitecture);
|
||||
err = target_parse_arch(&target->arch, (char*)opt_arch.value.ptr, opt_arch.value.len);
|
||||
assert(err == ErrorNone);
|
||||
|
||||
target->os = OsLinux;
|
||||
|
||||
|
|
|
@ -125,9 +125,7 @@ Error stage2_target_parse(struct ZigTarget *target, const char *zig_triple, cons
|
|||
if (!opt_archsub.is_some)
|
||||
return ErrorMissingArchitecture;
|
||||
|
||||
if ((err = target_parse_archsub(&target->arch, &target->sub_arch,
|
||||
(char*)opt_archsub.value.ptr, opt_archsub.value.len)))
|
||||
{
|
||||
if ((err = target_parse_arch(&target->arch, (char*)opt_archsub.value.ptr, opt_archsub.value.len))) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -279,12 +279,11 @@ struct Stage2TargetData;
|
|||
// ABI warning
|
||||
struct ZigTarget {
|
||||
enum ZigLLVM_ArchType arch;
|
||||
enum ZigLLVM_SubArchType sub_arch;
|
||||
|
||||
enum ZigLLVM_VendorType vendor;
|
||||
enum ZigLLVM_EnvironmentType abi;
|
||||
|
||||
enum ZigLLVM_EnvironmentType abi;
|
||||
Os os;
|
||||
|
||||
bool is_native;
|
||||
|
||||
struct ZigGLibCVersion *glibc_version; // null means default
|
||||
|
|
279
src/target.cpp
279
src/target.cpp
|
@ -15,60 +15,6 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
static const SubArchList subarch_list_list[] = {
|
||||
SubArchListNone,
|
||||
SubArchListArm32,
|
||||
SubArchListArm64,
|
||||
SubArchListKalimba,
|
||||
SubArchListMips,
|
||||
};
|
||||
|
||||
static const ZigLLVM_SubArchType subarch_list_arm32[] = {
|
||||
ZigLLVM_ARMSubArch_v8_5a,
|
||||
ZigLLVM_ARMSubArch_v8_4a,
|
||||
ZigLLVM_ARMSubArch_v8_3a,
|
||||
ZigLLVM_ARMSubArch_v8_2a,
|
||||
ZigLLVM_ARMSubArch_v8_1a,
|
||||
ZigLLVM_ARMSubArch_v8,
|
||||
ZigLLVM_ARMSubArch_v8r,
|
||||
ZigLLVM_ARMSubArch_v8m_baseline,
|
||||
ZigLLVM_ARMSubArch_v8m_mainline,
|
||||
ZigLLVM_ARMSubArch_v8_1m_mainline,
|
||||
ZigLLVM_ARMSubArch_v7,
|
||||
ZigLLVM_ARMSubArch_v7em,
|
||||
ZigLLVM_ARMSubArch_v7m,
|
||||
ZigLLVM_ARMSubArch_v7s,
|
||||
ZigLLVM_ARMSubArch_v7k,
|
||||
ZigLLVM_ARMSubArch_v7ve,
|
||||
ZigLLVM_ARMSubArch_v6,
|
||||
ZigLLVM_ARMSubArch_v6m,
|
||||
ZigLLVM_ARMSubArch_v6k,
|
||||
ZigLLVM_ARMSubArch_v6t2,
|
||||
ZigLLVM_ARMSubArch_v5,
|
||||
ZigLLVM_ARMSubArch_v5te,
|
||||
ZigLLVM_ARMSubArch_v4t,
|
||||
|
||||
};
|
||||
|
||||
static const ZigLLVM_SubArchType subarch_list_arm64[] = {
|
||||
ZigLLVM_ARMSubArch_v8_5a,
|
||||
ZigLLVM_ARMSubArch_v8_4a,
|
||||
ZigLLVM_ARMSubArch_v8_3a,
|
||||
ZigLLVM_ARMSubArch_v8_2a,
|
||||
ZigLLVM_ARMSubArch_v8_1a,
|
||||
ZigLLVM_ARMSubArch_v8,
|
||||
};
|
||||
|
||||
static const ZigLLVM_SubArchType subarch_list_kalimba[] = {
|
||||
ZigLLVM_KalimbaSubArch_v5,
|
||||
ZigLLVM_KalimbaSubArch_v4,
|
||||
ZigLLVM_KalimbaSubArch_v3,
|
||||
};
|
||||
|
||||
static const ZigLLVM_SubArchType subarch_list_mips[] = {
|
||||
ZigLLVM_MipsSubArch_r6,
|
||||
};
|
||||
|
||||
static const ZigLLVM_ArchType arch_list[] = {
|
||||
ZigLLVM_arm, // ARM (little endian): arm, armv.*, xscale
|
||||
ZigLLVM_armeb, // ARM (big endian): armeb
|
||||
|
@ -509,7 +455,6 @@ void get_native_target(ZigTarget *target) {
|
|||
ZigLLVM_ObjectFormatType oformat; // ignored; based on arch/os
|
||||
ZigLLVMGetNativeTarget(
|
||||
&target->arch,
|
||||
&target->sub_arch,
|
||||
&target->vendor,
|
||||
&os_type,
|
||||
&target->abi,
|
||||
|
@ -535,223 +480,18 @@ void target_init_default_glibc_version(ZigTarget *target) {
|
|||
*target->glibc_version = {2, 17, 0};
|
||||
}
|
||||
|
||||
Error target_parse_archsub(ZigLLVM_ArchType *out_arch, ZigLLVM_SubArchType *out_sub,
|
||||
const char *archsub_ptr, size_t archsub_len)
|
||||
{
|
||||
Error target_parse_arch(ZigLLVM_ArchType *out_arch, const char *arch_ptr, size_t arch_len) {
|
||||
*out_arch = ZigLLVM_UnknownArch;
|
||||
*out_sub = ZigLLVM_NoSubArch;
|
||||
for (size_t arch_i = 0; arch_i < array_length(arch_list); arch_i += 1) {
|
||||
ZigLLVM_ArchType arch = arch_list[arch_i];
|
||||
SubArchList sub_arch_list = target_subarch_list(arch);
|
||||
size_t subarch_count = target_subarch_count(sub_arch_list);
|
||||
if (mem_eql_str(archsub_ptr, archsub_len, target_arch_name(arch))) {
|
||||
if (mem_eql_str(arch_ptr, arch_len, target_arch_name(arch))) {
|
||||
*out_arch = arch;
|
||||
if (subarch_count == 0) {
|
||||
return ErrorNone;
|
||||
}
|
||||
}
|
||||
for (size_t sub_i = 0; sub_i < subarch_count; sub_i += 1) {
|
||||
ZigLLVM_SubArchType sub = target_subarch_enum(sub_arch_list, sub_i);
|
||||
char arch_name[64];
|
||||
int n = sprintf(arch_name, "%s%s", target_arch_name(arch), target_subarch_name(sub));
|
||||
if (mem_eql_mem(arch_name, n, archsub_ptr, archsub_len)) {
|
||||
*out_arch = arch;
|
||||
*out_sub = sub;
|
||||
return ErrorNone;
|
||||
}
|
||||
return ErrorNone;
|
||||
}
|
||||
}
|
||||
return ErrorUnknownArchitecture;
|
||||
}
|
||||
|
||||
SubArchList target_subarch_list(ZigLLVM_ArchType arch) {
|
||||
switch (arch) {
|
||||
case ZigLLVM_UnknownArch:
|
||||
zig_unreachable();
|
||||
case ZigLLVM_arm:
|
||||
case ZigLLVM_armeb:
|
||||
case ZigLLVM_thumb:
|
||||
case ZigLLVM_thumbeb:
|
||||
return SubArchListArm32;
|
||||
|
||||
case ZigLLVM_aarch64:
|
||||
case ZigLLVM_aarch64_be:
|
||||
case ZigLLVM_aarch64_32:
|
||||
return SubArchListArm64;
|
||||
|
||||
case ZigLLVM_kalimba:
|
||||
return SubArchListKalimba;
|
||||
|
||||
case ZigLLVM_arc:
|
||||
case ZigLLVM_avr:
|
||||
case ZigLLVM_bpfel:
|
||||
case ZigLLVM_bpfeb:
|
||||
case ZigLLVM_hexagon:
|
||||
case ZigLLVM_mips:
|
||||
case ZigLLVM_mipsel:
|
||||
case ZigLLVM_mips64:
|
||||
case ZigLLVM_mips64el:
|
||||
case ZigLLVM_msp430:
|
||||
case ZigLLVM_ppc:
|
||||
case ZigLLVM_ppc64:
|
||||
case ZigLLVM_ppc64le:
|
||||
case ZigLLVM_r600:
|
||||
case ZigLLVM_amdgcn:
|
||||
case ZigLLVM_riscv32:
|
||||
case ZigLLVM_riscv64:
|
||||
case ZigLLVM_sparc:
|
||||
case ZigLLVM_sparcv9:
|
||||
case ZigLLVM_sparcel:
|
||||
case ZigLLVM_systemz:
|
||||
case ZigLLVM_tce:
|
||||
case ZigLLVM_tcele:
|
||||
case ZigLLVM_x86:
|
||||
case ZigLLVM_x86_64:
|
||||
case ZigLLVM_xcore:
|
||||
case ZigLLVM_nvptx:
|
||||
case ZigLLVM_nvptx64:
|
||||
case ZigLLVM_le32:
|
||||
case ZigLLVM_le64:
|
||||
case ZigLLVM_amdil:
|
||||
case ZigLLVM_amdil64:
|
||||
case ZigLLVM_hsail:
|
||||
case ZigLLVM_hsail64:
|
||||
case ZigLLVM_spir:
|
||||
case ZigLLVM_spir64:
|
||||
case ZigLLVM_shave:
|
||||
case ZigLLVM_lanai:
|
||||
case ZigLLVM_wasm32:
|
||||
case ZigLLVM_wasm64:
|
||||
case ZigLLVM_renderscript32:
|
||||
case ZigLLVM_renderscript64:
|
||||
return SubArchListNone;
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
size_t target_subarch_count(SubArchList sub_arch_list) {
|
||||
switch (sub_arch_list) {
|
||||
case SubArchListNone:
|
||||
return 0;
|
||||
case SubArchListArm32:
|
||||
return array_length(subarch_list_arm32);
|
||||
case SubArchListArm64:
|
||||
return array_length(subarch_list_arm64);
|
||||
case SubArchListKalimba:
|
||||
return array_length(subarch_list_kalimba);
|
||||
case SubArchListMips:
|
||||
return array_length(subarch_list_mips);
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
ZigLLVM_SubArchType target_subarch_enum(SubArchList sub_arch_list, size_t i) {
|
||||
switch (sub_arch_list) {
|
||||
case SubArchListNone:
|
||||
zig_unreachable();
|
||||
case SubArchListArm32:
|
||||
assert(i < array_length(subarch_list_arm32));
|
||||
return subarch_list_arm32[i];
|
||||
case SubArchListArm64:
|
||||
assert(i < array_length(subarch_list_arm64));
|
||||
return subarch_list_arm64[i];
|
||||
case SubArchListKalimba:
|
||||
assert(i < array_length(subarch_list_kalimba));
|
||||
return subarch_list_kalimba[i];
|
||||
case SubArchListMips:
|
||||
assert(i < array_length(subarch_list_mips));
|
||||
return subarch_list_mips[i];
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
const char *target_subarch_name(ZigLLVM_SubArchType subarch) {
|
||||
switch (subarch) {
|
||||
case ZigLLVM_NoSubArch:
|
||||
return "";
|
||||
case ZigLLVM_ARMSubArch_v8_5a:
|
||||
return "v8_5a";
|
||||
case ZigLLVM_ARMSubArch_v8_4a:
|
||||
return "v8_4a";
|
||||
case ZigLLVM_ARMSubArch_v8_3a:
|
||||
return "v8_3a";
|
||||
case ZigLLVM_ARMSubArch_v8_2a:
|
||||
return "v8_2a";
|
||||
case ZigLLVM_ARMSubArch_v8_1a:
|
||||
return "v8_1a";
|
||||
case ZigLLVM_ARMSubArch_v8:
|
||||
return "v8a";
|
||||
case ZigLLVM_ARMSubArch_v8r:
|
||||
return "v8r";
|
||||
case ZigLLVM_ARMSubArch_v8m_baseline:
|
||||
return "v8m_baseline";
|
||||
case ZigLLVM_ARMSubArch_v8m_mainline:
|
||||
return "v8m_mainline";
|
||||
case ZigLLVM_ARMSubArch_v8_1m_mainline:
|
||||
return "v8_1m_mainline";
|
||||
case ZigLLVM_ARMSubArch_v7:
|
||||
return "v7a";
|
||||
case ZigLLVM_ARMSubArch_v7em:
|
||||
return "v7em";
|
||||
case ZigLLVM_ARMSubArch_v7m:
|
||||
return "v7m";
|
||||
case ZigLLVM_ARMSubArch_v7s:
|
||||
return "v7s";
|
||||
case ZigLLVM_ARMSubArch_v7k:
|
||||
return "v7k";
|
||||
case ZigLLVM_ARMSubArch_v7ve:
|
||||
return "v7ve";
|
||||
case ZigLLVM_ARMSubArch_v6:
|
||||
return "v6";
|
||||
case ZigLLVM_ARMSubArch_v6m:
|
||||
return "v6m";
|
||||
case ZigLLVM_ARMSubArch_v6k:
|
||||
return "v6k";
|
||||
case ZigLLVM_ARMSubArch_v6t2:
|
||||
return "v6t2";
|
||||
case ZigLLVM_ARMSubArch_v5:
|
||||
return "v5";
|
||||
case ZigLLVM_ARMSubArch_v5te:
|
||||
return "v5te";
|
||||
case ZigLLVM_ARMSubArch_v4t:
|
||||
return "v4t";
|
||||
case ZigLLVM_KalimbaSubArch_v3:
|
||||
return "v3";
|
||||
case ZigLLVM_KalimbaSubArch_v4:
|
||||
return "v4";
|
||||
case ZigLLVM_KalimbaSubArch_v5:
|
||||
return "v5";
|
||||
case ZigLLVM_MipsSubArch_r6:
|
||||
return "r6";
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
size_t target_subarch_list_count(void) {
|
||||
return array_length(subarch_list_list);
|
||||
}
|
||||
|
||||
SubArchList target_subarch_list_enum(size_t index) {
|
||||
assert(index < array_length(subarch_list_list));
|
||||
return subarch_list_list[index];
|
||||
}
|
||||
|
||||
const char *target_subarch_list_name(SubArchList sub_arch_list) {
|
||||
switch (sub_arch_list) {
|
||||
case SubArchListNone:
|
||||
return "None";
|
||||
case SubArchListArm32:
|
||||
return "Arm32";
|
||||
case SubArchListArm64:
|
||||
return "Arm64";
|
||||
case SubArchListKalimba:
|
||||
return "Kalimba";
|
||||
case SubArchListMips:
|
||||
return "Mips";
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
Error target_parse_os(Os *out_os, const char *os_ptr, size_t os_len) {
|
||||
for (size_t i = 0; i < array_length(os_list); i += 1) {
|
||||
Os os = os_list[i];
|
||||
|
@ -794,18 +534,16 @@ void init_all_targets(void) {
|
|||
|
||||
void target_triple_zig(Buf *triple, const ZigTarget *target) {
|
||||
buf_resize(triple, 0);
|
||||
buf_appendf(triple, "%s%s-%s-%s",
|
||||
buf_appendf(triple, "%s-%s-%s",
|
||||
target_arch_name(target->arch),
|
||||
target_subarch_name(target->sub_arch),
|
||||
target_os_name(target->os),
|
||||
target_abi_name(target->abi));
|
||||
}
|
||||
|
||||
void target_triple_llvm(Buf *triple, const ZigTarget *target) {
|
||||
buf_resize(triple, 0);
|
||||
buf_appendf(triple, "%s%s-%s-%s-%s",
|
||||
buf_appendf(triple, "%s-%s-%s-%s",
|
||||
ZigLLVMGetArchTypeName(target->arch),
|
||||
ZigLLVMGetSubArchTypeName(target->sub_arch),
|
||||
ZigLLVMGetVendorTypeName(target->vendor),
|
||||
ZigLLVMGetOSTypeName(get_llvm_os_type(target->os)),
|
||||
ZigLLVMGetEnvironmentTypeName(target->abi));
|
||||
|
@ -1182,10 +920,8 @@ bool target_can_exec(const ZigTarget *host_target, const ZigTarget *guest_target
|
|||
return true;
|
||||
}
|
||||
|
||||
if (guest_target->os == host_target->os && guest_target->arch == host_target->arch &&
|
||||
guest_target->sub_arch == host_target->sub_arch)
|
||||
{
|
||||
// OS, arch, and sub-arch match
|
||||
if (guest_target->os == host_target->os && guest_target->arch == host_target->arch) {
|
||||
// OS and arch match
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1607,7 +1343,6 @@ void target_libc_enum(size_t index, ZigTarget *out_target) {
|
|||
out_target->arch = libcs_available[index].arch;
|
||||
out_target->os = libcs_available[index].os;
|
||||
out_target->abi = libcs_available[index].abi;
|
||||
out_target->sub_arch = ZigLLVM_NoSubArch;
|
||||
out_target->vendor = ZigLLVM_UnknownVendor;
|
||||
out_target->is_native = false;
|
||||
}
|
||||
|
|
|
@ -12,15 +12,6 @@
|
|||
|
||||
struct Buf;
|
||||
|
||||
// Synchronize with target.cpp::subarch_list_list
|
||||
enum SubArchList {
|
||||
SubArchListNone,
|
||||
SubArchListArm32,
|
||||
SubArchListArm64,
|
||||
SubArchListKalimba,
|
||||
SubArchListMips,
|
||||
};
|
||||
|
||||
enum TargetSubsystem {
|
||||
TargetSubsystemConsole,
|
||||
TargetSubsystemWindows,
|
||||
|
@ -51,8 +42,7 @@ enum CIntType {
|
|||
};
|
||||
|
||||
Error target_parse_triple(ZigTarget *target, const char *triple, const char *mcpu);
|
||||
Error target_parse_archsub(ZigLLVM_ArchType *arch, ZigLLVM_SubArchType *sub,
|
||||
const char *archsub_ptr, size_t archsub_len);
|
||||
Error target_parse_arch(ZigLLVM_ArchType *arch, const char *arch_ptr, size_t arch_len);
|
||||
Error target_parse_os(Os *os, const char *os_ptr, size_t os_len);
|
||||
Error target_parse_abi(ZigLLVM_EnvironmentType *abi, const char *abi_ptr, size_t abi_len);
|
||||
|
||||
|
@ -63,15 +53,6 @@ size_t target_arch_count(void);
|
|||
ZigLLVM_ArchType target_arch_enum(size_t index);
|
||||
const char *target_arch_name(ZigLLVM_ArchType arch);
|
||||
|
||||
SubArchList target_subarch_list(ZigLLVM_ArchType arch);
|
||||
size_t target_subarch_count(SubArchList sub_arch_list);
|
||||
ZigLLVM_SubArchType target_subarch_enum(SubArchList subarch_list, size_t index);
|
||||
const char *target_subarch_name(ZigLLVM_SubArchType subarch);
|
||||
|
||||
size_t target_subarch_list_count(void);
|
||||
SubArchList target_subarch_list_enum(size_t index);
|
||||
const char *target_subarch_list_name(SubArchList sub_arch_list);
|
||||
|
||||
const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch);
|
||||
|
||||
size_t target_vendor_count(void);
|
||||
|
|
|
@ -806,7 +806,7 @@ const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType env_type) {
|
|||
return (const char*)Triple::getEnvironmentTypeName((Triple::EnvironmentType)env_type).bytes_begin();
|
||||
}
|
||||
|
||||
void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *sub_arch_type,
|
||||
void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type,
|
||||
ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type,
|
||||
ZigLLVM_ObjectFormatType *oformat)
|
||||
{
|
||||
|
@ -814,7 +814,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
|
|||
Triple triple(Triple::normalize(native_triple));
|
||||
|
||||
*arch_type = (ZigLLVM_ArchType)triple.getArch();
|
||||
*sub_arch_type = (ZigLLVM_SubArchType)triple.getSubArch();
|
||||
*vendor_type = (ZigLLVM_VendorType)triple.getVendor();
|
||||
*os_type = (ZigLLVM_OSType)triple.getOS();
|
||||
*environ_type = (ZigLLVM_EnvironmentType)triple.getEnvironment();
|
||||
|
@ -823,68 +822,6 @@ void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *su
|
|||
free(native_triple);
|
||||
}
|
||||
|
||||
const char *ZigLLVMGetSubArchTypeName(ZigLLVM_SubArchType sub_arch) {
|
||||
switch (sub_arch) {
|
||||
case ZigLLVM_NoSubArch:
|
||||
return "";
|
||||
case ZigLLVM_ARMSubArch_v8_5a:
|
||||
return "v8.5a";
|
||||
case ZigLLVM_ARMSubArch_v8_4a:
|
||||
return "v8.4a";
|
||||
case ZigLLVM_ARMSubArch_v8_3a:
|
||||
return "v8.3a";
|
||||
case ZigLLVM_ARMSubArch_v8_2a:
|
||||
return "v8.2a";
|
||||
case ZigLLVM_ARMSubArch_v8_1a:
|
||||
return "v8.1a";
|
||||
case ZigLLVM_ARMSubArch_v8:
|
||||
return "v8a";
|
||||
case ZigLLVM_ARMSubArch_v8r:
|
||||
return "v8r";
|
||||
case ZigLLVM_ARMSubArch_v8m_baseline:
|
||||
return "v8m.base";
|
||||
case ZigLLVM_ARMSubArch_v8m_mainline:
|
||||
return "v8m.main";
|
||||
case ZigLLVM_ARMSubArch_v8_1m_mainline:
|
||||
return "v8.1m.main";
|
||||
case ZigLLVM_ARMSubArch_v7:
|
||||
return "v7a";
|
||||
case ZigLLVM_ARMSubArch_v7em:
|
||||
return "v7em";
|
||||
case ZigLLVM_ARMSubArch_v7m:
|
||||
return "v7m";
|
||||
case ZigLLVM_ARMSubArch_v7s:
|
||||
return "v7s";
|
||||
case ZigLLVM_ARMSubArch_v7k:
|
||||
return "v7k";
|
||||
case ZigLLVM_ARMSubArch_v7ve:
|
||||
return "v7ve";
|
||||
case ZigLLVM_ARMSubArch_v6:
|
||||
return "v6";
|
||||
case ZigLLVM_ARMSubArch_v6m:
|
||||
return "v6m";
|
||||
case ZigLLVM_ARMSubArch_v6k:
|
||||
return "v6k";
|
||||
case ZigLLVM_ARMSubArch_v6t2:
|
||||
return "v6t2";
|
||||
case ZigLLVM_ARMSubArch_v5:
|
||||
return "v5";
|
||||
case ZigLLVM_ARMSubArch_v5te:
|
||||
return "v5te";
|
||||
case ZigLLVM_ARMSubArch_v4t:
|
||||
return "v4t";
|
||||
case ZigLLVM_KalimbaSubArch_v3:
|
||||
return "v3";
|
||||
case ZigLLVM_KalimbaSubArch_v4:
|
||||
return "v4";
|
||||
case ZigLLVM_KalimbaSubArch_v5:
|
||||
return "v5";
|
||||
case ZigLLVM_MipsSubArch_r6:
|
||||
return "r6";
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
void ZigLLVMAddModuleDebugInfoFlag(LLVMModuleRef module) {
|
||||
unwrap(module)->addModuleFlag(Module::Warning, "Debug Info Version", DEBUG_METADATA_VERSION);
|
||||
unwrap(module)->addModuleFlag(Module::Warning, "Dwarf Version", 4);
|
||||
|
@ -1218,35 +1155,6 @@ static_assert((Triple::ArchType)ZigLLVM_renderscript32 == Triple::renderscript32
|
|||
static_assert((Triple::ArchType)ZigLLVM_renderscript64 == Triple::renderscript64, "");
|
||||
static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");
|
||||
|
||||
static_assert((Triple::SubArchType)ZigLLVM_NoSubArch == Triple::NoSubArch, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_4a == Triple::ARMSubArch_v8_4a, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_3a == Triple::ARMSubArch_v8_3a, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_2a == Triple::ARMSubArch_v8_2a, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_1a == Triple::ARMSubArch_v8_1a, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8 == Triple::ARMSubArch_v8, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8r == Triple::ARMSubArch_v8r, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8m_baseline == Triple::ARMSubArch_v8m_baseline, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8m_mainline == Triple::ARMSubArch_v8m_mainline, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v8_1m_mainline == Triple::ARMSubArch_v8_1m_mainline, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7 == Triple::ARMSubArch_v7, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7em == Triple::ARMSubArch_v7em, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7m == Triple::ARMSubArch_v7m, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7s == Triple::ARMSubArch_v7s, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7k == Triple::ARMSubArch_v7k, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v7ve == Triple::ARMSubArch_v7ve, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6 == Triple::ARMSubArch_v6, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6m == Triple::ARMSubArch_v6m, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6k == Triple::ARMSubArch_v6k, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v6t2 == Triple::ARMSubArch_v6t2, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v5 == Triple::ARMSubArch_v5, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v5te == Triple::ARMSubArch_v5te, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_ARMSubArch_v4t == Triple::ARMSubArch_v4t, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v3 == Triple::KalimbaSubArch_v3, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v4 == Triple::KalimbaSubArch_v4, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v5 == Triple::KalimbaSubArch_v5, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_KalimbaSubArch_v5 == Triple::KalimbaSubArch_v5, "");
|
||||
static_assert((Triple::SubArchType)ZigLLVM_MipsSubArch_r6 == Triple::MipsSubArch_r6, "");
|
||||
|
||||
static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");
|
||||
static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");
|
||||
|
|
|
@ -324,41 +324,6 @@ enum ZigLLVM_ArchType {
|
|||
ZigLLVM_LastArchType = ZigLLVM_renderscript64
|
||||
};
|
||||
|
||||
// synchronize with lists in target.cpp
|
||||
enum ZigLLVM_SubArchType {
|
||||
ZigLLVM_NoSubArch,
|
||||
|
||||
ZigLLVM_ARMSubArch_v8_5a,
|
||||
ZigLLVM_ARMSubArch_v8_4a,
|
||||
ZigLLVM_ARMSubArch_v8_3a,
|
||||
ZigLLVM_ARMSubArch_v8_2a,
|
||||
ZigLLVM_ARMSubArch_v8_1a,
|
||||
ZigLLVM_ARMSubArch_v8,
|
||||
ZigLLVM_ARMSubArch_v8r,
|
||||
ZigLLVM_ARMSubArch_v8m_baseline,
|
||||
ZigLLVM_ARMSubArch_v8m_mainline,
|
||||
ZigLLVM_ARMSubArch_v8_1m_mainline,
|
||||
ZigLLVM_ARMSubArch_v7,
|
||||
ZigLLVM_ARMSubArch_v7em,
|
||||
ZigLLVM_ARMSubArch_v7m,
|
||||
ZigLLVM_ARMSubArch_v7s,
|
||||
ZigLLVM_ARMSubArch_v7k,
|
||||
ZigLLVM_ARMSubArch_v7ve,
|
||||
ZigLLVM_ARMSubArch_v6,
|
||||
ZigLLVM_ARMSubArch_v6m,
|
||||
ZigLLVM_ARMSubArch_v6k,
|
||||
ZigLLVM_ARMSubArch_v6t2,
|
||||
ZigLLVM_ARMSubArch_v5,
|
||||
ZigLLVM_ARMSubArch_v5te,
|
||||
ZigLLVM_ARMSubArch_v4t,
|
||||
|
||||
ZigLLVM_KalimbaSubArch_v3,
|
||||
ZigLLVM_KalimbaSubArch_v4,
|
||||
ZigLLVM_KalimbaSubArch_v5,
|
||||
|
||||
ZigLLVM_MipsSubArch_r6,
|
||||
};
|
||||
|
||||
enum ZigLLVM_VendorType {
|
||||
ZigLLVM_UnknownVendor,
|
||||
|
||||
|
@ -518,7 +483,6 @@ LLVMValueRef ZigLLVMBuildAtomicRMW(LLVMBuilderRef B, enum ZigLLVM_AtomicRMWBinOp
|
|||
#define ZigLLVM_DIFlags_AllCallsDescribed (1U << 29)
|
||||
|
||||
ZIG_EXTERN_C const char *ZigLLVMGetArchTypeName(enum ZigLLVM_ArchType arch);
|
||||
ZIG_EXTERN_C const char *ZigLLVMGetSubArchTypeName(enum ZigLLVM_SubArchType sub_arch);
|
||||
ZIG_EXTERN_C const char *ZigLLVMGetVendorTypeName(enum ZigLLVM_VendorType vendor);
|
||||
ZIG_EXTERN_C const char *ZigLLVMGetOSTypeName(enum ZigLLVM_OSType os);
|
||||
ZIG_EXTERN_C const char *ZigLLVMGetEnvironmentTypeName(enum ZigLLVM_EnvironmentType abi);
|
||||
|
@ -532,7 +496,7 @@ ZIG_EXTERN_C bool ZigLLVMWriteArchive(const char *archive_name, const char **fil
|
|||
bool ZigLLVMWriteImportLibrary(const char *def_path, const enum ZigLLVM_ArchType arch,
|
||||
const char *output_lib_path, const bool kill_at);
|
||||
|
||||
ZIG_EXTERN_C void ZigLLVMGetNativeTarget(enum ZigLLVM_ArchType *arch_type, enum ZigLLVM_SubArchType *sub_arch_type,
|
||||
ZIG_EXTERN_C void ZigLLVMGetNativeTarget(enum ZigLLVM_ArchType *arch_type,
|
||||
enum ZigLLVM_VendorType *vendor_type, enum ZigLLVM_OSType *os_type, enum ZigLLVM_EnvironmentType *environ_type,
|
||||
enum ZigLLVM_ObjectFormatType *oformat);
|
||||
|
||||
|
|
Loading…
Reference in New Issue