Skip to content

Commit

Permalink
cbe: remove threadlocal variables in single threaded mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Apr 8, 2024
1 parent fbb38a7 commit d979df5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codegen/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 };
Expand Down

0 comments on commit d979df5

Please sign in to comment.