zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0f1d92e2cfda7ac633cc66fdf2b0e5e27cdf0f98 (tree)
parent 68d7e4a1b60a52b59bc148a81458a89b9b739ab1
Author: Shritesh Bhattarai <shritesh@shritesh.com>
Date:   Sat, 13 Apr 2019 18:40:28 -0500

wasm: force single threaded

Diffstat:
Msrc/main.cpp | 4++++
Msrc/target.cpp | 4++++
Msrc/target.hpp | 1+
3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp @@ -921,6 +921,10 @@ int main(int argc, char **argv) { } } + if (target_is_single_threaded(&target)) { + is_single_threaded = true; + } + if (output_dir != nullptr && enable_cache == CacheOptOn) { fprintf(stderr, "`--output-dir` is incompatible with --cache on.\n"); return print_error_usage(arg0); diff --git a/src/target.cpp b/src/target.cpp @@ -1371,6 +1371,10 @@ bool target_is_wasm(const ZigTarget *target) { return target->arch == ZigLLVM_wasm32 || target->arch == ZigLLVM_wasm64; } +bool target_is_single_threaded(const ZigTarget *target) { + return target_is_wasm(target); +} + ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) { switch (os) { case OsFreestanding: diff --git a/src/target.hpp b/src/target.hpp @@ -171,6 +171,7 @@ bool target_abi_is_musl(ZigLLVM_EnvironmentType abi); bool target_is_glibc(const ZigTarget *target); bool target_is_musl(const ZigTarget *target); bool target_is_wasm(const ZigTarget *target); +bool target_is_single_threaded(const ZigTarget *target); uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);