| author | |
| committer | |
| log | b9c943b0667ed8253382cb787d4705f6619f7296 |
| tree | ca7a8ca8de7c6475dbfd23c7d23a37dc62cbdaaa |
| parent | 0c88b1ce73a926e60464c96a5a3f8ac8d9f84a8c |
3 files changed, 10 insertions(+), 24 deletions(-)
src/target.cpp+10-3| ... | @@ -5,9 +5,10 @@ | ... | @@ -5,9 +5,10 @@ |
| 5 | * See http://opensource.org/licenses/MIT | 5 | * See http://opensource.org/licenses/MIT |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include "buffer.hpp" | ||
| 9 | #include "error.hpp" | ||
| 8 | #include "target.hpp" | 10 | #include "target.hpp" |
| 9 | #include "util.hpp" | 11 | #include "util.hpp" |
| 10 | #include "error.hpp" | ||
| 11 | 12 | ||
| 12 | #include <stdio.h> | 13 | #include <stdio.h> |
| 13 | 14 | ||
| ... | @@ -282,8 +283,14 @@ void init_all_targets(void) { | ... | @@ -282,8 +283,14 @@ void init_all_targets(void) { |
| 282 | } | 283 | } |
| 283 | 284 | ||
| 284 | void get_target_triple(Buf *triple, const ZigTarget *target) { | 285 | void get_target_triple(Buf *triple, const ZigTarget *target) { |
| 285 | ZigLLVMGetTargetTriple(triple, target->arch.arch, target->arch.sub_arch, | 286 | char arch_name[50]; |
| 286 | target->vendor, target->os, target->env_type, target->oformat); | 287 | get_arch_name(arch_name, &target->arch); |
| 288 | |||
| 289 | buf_resize(triple, 0); | ||
| 290 | buf_appendf(triple, "%s-%s-%s-%s", arch_name, | ||
| 291 | ZigLLVMGetVendorTypeName(target->vendor), | ||
| 292 | ZigLLVMGetOSTypeName(target->os), | ||
| 293 | ZigLLVMGetEnvironmentTypeName(target->env_type)); | ||
| 287 | } | 294 | } |
| 288 | 295 | ||
| 289 | static bool is_os_darwin(ZigTarget *target) { | 296 | static bool is_os_darwin(ZigTarget *target) { |
src/zig_llvm.cpp-18| ... | @@ -708,24 +708,6 @@ LLVMValueRef ZigLLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, | ... | @@ -708,24 +708,6 @@ LLVMValueRef ZigLLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, |
| 708 | 708 | ||
| 709 | #include "buffer.hpp" | 709 | #include "buffer.hpp" |
| 710 | 710 | ||
| 711 | void ZigLLVMGetTargetTriple(Buf *out_buf, ZigLLVM_ArchType arch_type, ZigLLVM_SubArchType sub_arch_type, | ||
| 712 | ZigLLVM_VendorType vendor_type, ZigLLVM_OSType os_type, ZigLLVM_EnvironmentType environ_type, | ||
| 713 | ZigLLVM_ObjectFormatType oformat) | ||
| 714 | { | ||
| 715 | Triple triple; | ||
| 716 | |||
| 717 | triple.setArch((Triple::ArchType)arch_type); | ||
| 718 | // TODO how to set the sub arch? | ||
| 719 | triple.setVendor((Triple::VendorType)vendor_type); | ||
| 720 | triple.setOS((Triple::OSType)os_type); | ||
| 721 | triple.setEnvironment((Triple::EnvironmentType)environ_type); | ||
| 722 | // I guess it's a "triple" because we don't set the object format? | ||
| 723 | //triple.setObjectFormat((Triple::ObjectFormatType)oformat); | ||
| 724 | |||
| 725 | const std::string &str = triple.str(); | ||
| 726 | buf_init_from_mem(out_buf, str.c_str(), str.size()); | ||
| 727 | } | ||
| 728 | |||
| 729 | enum FloatAbi { | 711 | enum FloatAbi { |
| 730 | FloatAbiHard, | 712 | FloatAbiHard, |
| 731 | FloatAbiSoft, | 713 | FloatAbiSoft, |
src/zig_llvm.hpp-3| ... | @@ -347,9 +347,6 @@ struct Buf; | ... | @@ -347,9 +347,6 @@ struct Buf; |
| 347 | void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *sub_arch_type, | 347 | void ZigLLVMGetNativeTarget(ZigLLVM_ArchType *arch_type, ZigLLVM_SubArchType *sub_arch_type, |
| 348 | ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type, | 348 | ZigLLVM_VendorType *vendor_type, ZigLLVM_OSType *os_type, ZigLLVM_EnvironmentType *environ_type, |
| 349 | ZigLLVM_ObjectFormatType *oformat); | 349 | ZigLLVM_ObjectFormatType *oformat); |
| 350 | void ZigLLVMGetTargetTriple(Buf *out_buf, ZigLLVM_ArchType arch_type, ZigLLVM_SubArchType sub_arch_type, | ||
| 351 | ZigLLVM_VendorType vendor_type, ZigLLVM_OSType os_type, ZigLLVM_EnvironmentType environ_type, | ||
| 352 | ZigLLVM_ObjectFormatType oformat); | ||
| 353 | 350 | ||
| 354 | 351 | ||
| 355 | Buf *get_dynamic_linker(LLVMTargetMachineRef target_machine); | 352 | Buf *get_dynamic_linker(LLVMTargetMachineRef target_machine); |