aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-30 23:24:34 +0100
committergingerBill <bill@gingerbill.org>2021-10-30 23:24:34 +0100
commit5bc8a491a7768da0019b7b17da637e681f2ace90 (patch)
tree71186a22f6fa5e54c83c8e300309ce2ffa0deeb7 /src/llvm_abi.cpp
parent87952fdb8ed56fcf926bea81e3247ff3c6395e31 (diff)
Begin work on supporting `wasm64`; Correct `wasm32` compilation behaviour
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 9e7f4b290..aa12cc352 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -1061,19 +1061,27 @@ LB_ABI_INFO(lb_get_abi_info) {
}
}
- if (build_context.metrics.arch == TargetArch_amd64) {
+ switch (build_context.metrics.arch) {
+ case TargetArch_amd64:
if (build_context.metrics.os == TargetOs_windows) {
return lbAbiAmd64Win64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
} else {
return lbAbiAmd64SysV::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
}
- } else if (build_context.metrics.arch == TargetArch_386) {
+ case TargetArch_386:
return lbAbi386::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
- } else if (build_context.metrics.arch == TargetArch_arm64) {
+ case TargetArch_arm64:
return lbAbiArm64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
- } else if (build_context.metrics.arch == TargetArch_wasm32) {
+ case TargetArch_wasm32:
+ // TODO(bill): implement wasm32's ABI correct
+ // NOTE(bill): this ABI is only an issue for WASI compatibility
return lbAbi386::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
+ case TargetArch_wasm64:
+ // TODO(bill): implement wasm64's ABI correct
+ // NOTE(bill): this ABI is only an issue for WASI compatibility
+ return lbAbiAmd64SysV::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention);
}
+
GB_PANIC("Unsupported ABI");
return {};
}