Skip to content

Commit

Permalink
CBE: revert broken change that got missed
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 authored and andrewrk committed Dec 5, 2022
1 parent 70ad5bc commit 4ee79aa
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/codegen/c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1549,11 +1549,7 @@ pub const DeclGen = struct {
return name;
}

fn renderTupleTypedef(
dg: *DeclGen,
t: Type,
kind: TypedefKind,
) error{ OutOfMemory, AnalysisFail }![]const u8 {
fn renderTupleTypedef(dg: *DeclGen, t: Type) error{ OutOfMemory, AnalysisFail }![]const u8 {
var buffer = std.ArrayList(u8).init(dg.typedefs.allocator);
defer buffer.deinit();

Expand All @@ -1565,7 +1561,7 @@ pub const DeclGen = struct {
if (!field_ty.hasRuntimeBits() or fields.values[i].tag() != .unreachable_value) continue;

try buffer.append(' ');
try dg.renderTypeAndName(buffer.writer(), field_ty, .{ .field = field_id }, .Mut, 0, kind);
try dg.renderTypeAndName(buffer.writer(), field_ty, .{ .field = field_id }, .Mut, 0, .Complete);
try buffer.appendSlice(";\n");

field_id += 1;
Expand Down Expand Up @@ -1987,7 +1983,7 @@ pub const DeclGen = struct {
const tuple_ty = Type.initPayload(&tuple_pl.base);

const name = dg.getTypedefName(tuple_ty) orelse
try dg.renderTupleTypedef(tuple_ty, kind);
try dg.renderTupleTypedef(tuple_ty);

try w.writeAll(name);
} else switch (kind) {
Expand Down

0 comments on commit 4ee79aa

Please sign in to comment.