authorgravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-04-12 10:54:15-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-12 13:17:59-04:00
log63f2e96eeaaa032ffa9ff11a4a632d8032883233
treefcce8b226d6c398cee2fe314f415c8948ae9a247
parent6284a4c534771797406ceb945e5b7985d591d62b

wasm: use .wasm ext for exe


3 files changed, 8 insertions(+), 2 deletions(-)

src/codegen.cpp+1-2
...@@ -7953,8 +7953,7 @@ static void init(CodeGen *g) {...@@ -7953,8 +7953,7 @@ static void init(CodeGen *g) {
7953 }7953 }
7954 }7954 }
79557955
7956 bool is_wasm = g->zig_target->arch == ZigLLVM_wasm32 || g->zig_target->arch == ZigLLVM_wasm64;7956 g->have_err_ret_tracing = !target_is_wasm(g->zig_target) && g->build_mode != BuildModeFastRelease && g->build_mode != BuildModeSmallRelease;
7957 g->have_err_ret_tracing = !is_wasm && g->build_mode != BuildModeFastRelease && g->build_mode != BuildModeSmallRelease;
79587957
7959 define_builtin_fns(g);7958 define_builtin_fns(g);
7960 Error err;7959 Error err;
src/target.cpp+6
...@@ -965,6 +965,8 @@ const char *target_exe_file_ext(const ZigTarget *target) {...@@ -965,6 +965,8 @@ const char *target_exe_file_ext(const ZigTarget *target) {
965 return ".exe";965 return ".exe";
966 } else if (target->os == OsUefi) {966 } else if (target->os == OsUefi) {
967 return ".efi";967 return ".efi";
968 } else if (target_is_wasm(target)) {
969 return ".wasm";
968 } else {970 } else {
969 return "";971 return "";
970 }972 }
...@@ -1365,6 +1367,10 @@ bool target_is_musl(const ZigTarget *target) {...@@ -1365,6 +1367,10 @@ bool target_is_musl(const ZigTarget *target) {
1365 return target->os == OsLinux && target_abi_is_musl(target->abi);1367 return target->os == OsLinux && target_abi_is_musl(target->abi);
1366}1368}
13671369
1370bool target_is_wasm(const ZigTarget *target) {
1371 return target->arch == ZigLLVM_wasm32 || target->arch == ZigLLVM_wasm64;
1372}
1373
1368ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {1374ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
1369 switch (os) {1375 switch (os) {
1370 case OsFreestanding:1376 case OsFreestanding:
src/target.hpp+1
...@@ -170,6 +170,7 @@ bool target_abi_is_gnu(ZigLLVM_EnvironmentType abi);...@@ -170,6 +170,7 @@ bool target_abi_is_gnu(ZigLLVM_EnvironmentType abi);
170bool target_abi_is_musl(ZigLLVM_EnvironmentType abi);170bool target_abi_is_musl(ZigLLVM_EnvironmentType abi);
171bool target_is_glibc(const ZigTarget *target);171bool target_is_glibc(const ZigTarget *target);
172bool target_is_musl(const ZigTarget *target);172bool target_is_musl(const ZigTarget *target);
173bool target_is_wasm(const ZigTarget *target);
173174
174uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);175uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch);
175176