aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-12-12 13:36:33 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-01-01 17:51:19 -0700
commit9a48a5ab0784ae9744c72cfcc6d7ad9b2cea6a9c (patch)
treee4d9e85b058a1cf23776c8f30bd3fc70e2fdfff5 /src/arch/wasm/CodeGen.zig
parent43720be04af8ddb8334b210ff936a834fb8871a7 (diff)
downloadzig-9a48a5ab0784ae9744c72cfcc6d7ad9b2cea6a9c.tar.gz
zig-9a48a5ab0784ae9744c72cfcc6d7ad9b2cea6a9c.zip
compiler: update references to single_threaded
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index aa6c2dea79..e0be273c26 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -7724,10 +7724,13 @@ fn airAtomicRmw(func: *CodeGen, inst: Air.Inst.Index) InnerError!void {
}
fn airFence(func: *CodeGen, inst: Air.Inst.Index) InnerError!void {
+ const zcu = func.bin_file.base.comp.module.?;
// Only when the atomic feature is enabled, and we're not building
// for a single-threaded build, can we emit the `fence` instruction.
// In all other cases, we emit no instructions for a fence.
- if (func.useAtomicFeature() and !func.bin_file.base.options.single_threaded) {
+ const func_namespace = zcu.namespacePtr(zcu.declPtr(func.decl).namespace);
+ const single_threaded = func_namespace.file_scope.mod.single_threaded;
+ if (func.useAtomicFeature() and !single_threaded) {
try func.addAtomicTag(.atomic_fence);
}