aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-02-10 15:41:50 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-02-10 15:41:50 -0700
commit1ff2edf67ef7a5d434697bb494247b76f34f6c84 (patch)
treef395713208e536e8b3cb6aee6ff1fb1574898f85 /src/zig_llvm.cpp
parentb988017547581ea39163913e400c962f74fc9b32 (diff)
downloadzig-1ff2edf67ef7a5d434697bb494247b76f34f6c84.tar.gz
zig-1ff2edf67ef7a5d434697bb494247b76f34f6c84.zip
add "targets" command to list architectures, oses, abis
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 5749a996d5..277a155fe0 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -514,8 +514,32 @@ void LLVMZigSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) {
}
}
+
+static_assert((Triple::ArchType)ZigLLVM_LastArchType == Triple::LastArchType, "");
+static_assert((Triple::VendorType)ZigLLVM_LastVendorType == Triple::LastVendorType, "");
+static_assert((Triple::OSType)ZigLLVM_LastOSType == Triple::LastOSType, "");
+static_assert((Triple::EnvironmentType)ZigLLVM_LastEnvironmentType == Triple::LastEnvironmentType, "");
+
+const char *ZigLLVMGetArchTypeName(ZigLLVM_ArchType arch) {
+ return Triple::getArchTypeName((Triple::ArchType)arch);
+}
+
+const char *ZigLLVMGetVendorTypeName(ZigLLVM_VendorType vendor) {
+ return Triple::getVendorTypeName((Triple::VendorType)vendor);
+}
+
+const char *ZigLLVMGetOSTypeName(ZigLLVM_OSType os) {
+ return Triple::getOSTypeName((Triple::OSType)os);
+}
+
+const char *ZigLLVMGetEnvironmentTypeName(ZigLLVM_EnvironmentType environ) {
+ return Triple::getEnvironmentTypeName((Triple::EnvironmentType)environ);
+}
+
//------------------------------------
+#include "buffer.hpp"
+
enum FloatAbi {
FloatAbiHard,
FloatAbiSoft,