aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 58bf919b1f..3f3147ca80 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -215,7 +215,7 @@ pub const DeclGen = struct {
val: Value,
decl: *Decl,
) error{ OutOfMemory, AnalysisFail }!void {
- markDeclAlive(decl);
+ decl.markAlive();
if (ty.isSlice()) {
try writer.writeByte('(');
@@ -253,19 +253,6 @@ pub const DeclGen = struct {
try dg.renderDeclName(decl, writer);
}
- fn markDeclAlive(decl: *Decl) void {
- if (decl.alive) return;
- decl.alive = true;
-
- // This is the first time we are marking this Decl alive. We must
- // therefore recurse into its value and mark any Decl it references
- // as also alive, so that any Decl referenced does not get garbage collected.
-
- if (decl.val.pointerDecl()) |pointee| {
- return markDeclAlive(pointee);
- }
- }
-
fn renderInt128(
writer: anytype,
int_val: anytype,