aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-04-08 00:23:37 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2024-04-08 13:20:02 -0400
commitd979df585d05de8d7385495fe6aee2b1d4e1380f (patch)
tree334dc3e531f7c58038e6f294e6731fe05ceebc2c /src/codegen/c.zig
parentfbb38a7682d43bd4ddc849e085347ef33978e240 (diff)
downloadzig-d979df585d05de8d7385495fe6aee2b1d4e1380f.tar.gz
zig-d979df585d05de8d7385495fe6aee2b1d4e1380f.zip
cbe: remove threadlocal variables in single threaded mode
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index ed5ab74405..95f4ecc4ac 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -2078,7 +2078,7 @@ pub const DeclGen = struct {
else
false;
if (variable.is_weak_linkage or export_weak_linkage) try fwd.writeAll("zig_weak_linkage ");
- if (variable.is_threadlocal) try fwd.writeAll("zig_threadlocal ");
+ if (variable.is_threadlocal and !dg.mod.single_threaded) try fwd.writeAll("zig_threadlocal ");
try dg.renderTypeAndName(
fwd,
decl.typeOf(zcu),
@@ -2899,7 +2899,7 @@ pub fn genDecl(o: *Object) !void {
const w = o.writer();
if (!is_global) try w.writeAll("static ");
if (variable.is_weak_linkage) try w.writeAll("zig_weak_linkage ");
- if (variable.is_threadlocal) try w.writeAll("zig_threadlocal ");
+ if (variable.is_threadlocal and !o.dg.mod.single_threaded) try w.writeAll("zig_threadlocal ");
if (zcu.intern_pool.stringToSliceUnwrap(decl.@"linksection")) |s|
try w.print("zig_linksection({s}) ", .{fmtStringLiteral(s, null)});
const decl_c_value = .{ .decl = decl_index };