From 882ad7825792bb130de4455e63f7872c8a157968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 19 Feb 2026 18:32:46 +0000 Subject: [PATCH] Remove unimplemented InternPool dump stubs Both zig_dump_intern_pool and c_dump_intern_pool were unimplemented stubs with no callers. InternPool correctness is validated by unit tests and Air comparison. Co-Authored-By: Claude Opus 4.6 --- build.zig | 4 ++-- src/verbose_air.zig | 4 ---- src/verbose_intern_pool.zig | 23 ----------------------- stage0/dump.h | 8 -------- stage0/verbose_intern_pool.c | 13 ------------- stage0/verbose_intern_pool.h | 11 ----------- 6 files changed, 2 insertions(+), 61 deletions(-) delete mode 100644 src/verbose_intern_pool.zig delete mode 100644 stage0/verbose_intern_pool.c delete mode 100644 stage0/verbose_intern_pool.h diff --git a/build.zig b/build.zig index 5057e4d472..f085583eff 100644 --- a/build.zig +++ b/build.zig @@ -10,8 +10,8 @@ const assert = std.debug.assert; const DevEnv = @import("src/dev.zig").Env; const ValueInterpretMode = enum { direct, by_name }; -const zig0_headers = &[_][]const u8{ "common.h", "ast.h", "parser.h", "zir.h", "astgen.h", "intern_pool.h", "air.h", "type.h", "value.h", "sema.h", "dump.h", "verbose_intern_pool.h" }; -const zig0_c_lib_files = &[_][]const u8{ "tokenizer.c", "ast.c", "zig0.c", "parser.c", "zir.c", "astgen.c", "intern_pool.c", "air.c", "type.c", "value.c", "sema.c", "verbose_intern_pool.c" }; +const zig0_headers = &[_][]const u8{ "common.h", "ast.h", "parser.h", "zir.h", "astgen.h", "intern_pool.h", "air.h", "type.h", "value.h", "sema.h", "dump.h" }; +const zig0_c_lib_files = &[_][]const u8{ "tokenizer.c", "ast.c", "zig0.c", "parser.c", "zir.c", "astgen.c", "intern_pool.c", "air.c", "type.c", "value.c", "sema.c" }; const zig0_all_c_files = zig0_c_lib_files ++ &[_][]const u8{"main.c"}; const zig0_cflags = &[_][]const u8{ "-std=c11", diff --git a/src/verbose_air.zig b/src/verbose_air.zig index 6121cf3fb6..1fd81f49c6 100644 --- a/src/verbose_air.zig +++ b/src/verbose_air.zig @@ -9,10 +9,6 @@ const Compilation = zig_internals.Compilation; const Package = zig_internals.Package; const Air = zig_internals.Air; -comptime { - _ = @import("verbose_intern_pool.zig"); -} - /// Matches C `Air` struct layout (air.h). const CAir = extern struct { inst_len: u32, diff --git a/src/verbose_intern_pool.zig b/src/verbose_intern_pool.zig deleted file mode 100644 index f5c8cbb12c..0000000000 --- a/src/verbose_intern_pool.zig +++ /dev/null @@ -1,23 +0,0 @@ -// verbose_intern_pool.zig — Zig-side dumper for InternPool text output. -// Compiles source via the Zig compiler pipeline and dumps the InternPool. -// Exports a C-compatible function for use by stage0 tests. - -const std = @import("std"); - -const DumpResult = extern struct { - text: ?[*:0]u8, - error_msg: ?[*:0]u8, -}; - -export fn zig_dump_intern_pool( - source_ptr: [*]const u8, - source_len: usize, -) DumpResult { - // Stub: not yet implemented. - _ = source_ptr; - _ = source_len; - const gpa = std.heap.c_allocator; - const result = gpa.dupeZ(u8, "") catch - return .{ .text = null, .error_msg = null }; - return .{ .text = result.ptr, .error_msg = null }; -} diff --git a/stage0/dump.h b/stage0/dump.h index bf0bf54c14..e0b17caee7 100644 --- a/stage0/dump.h +++ b/stage0/dump.h @@ -14,12 +14,4 @@ typedef struct { extern AirCompareResult zig_compare_air(const char* src_path, const void* c_funcs, uint32_t c_func_count); extern void zig_compare_result_free(AirCompareResult* result); -// InternPool dumper (text-based, separate concern). -typedef struct { - char* text; // Heap-allocated, NULL on error. Caller frees. - char* error_msg; // Heap-allocated, NULL on success. Caller frees. -} DumpResult; - -extern DumpResult zig_dump_intern_pool(const char* source, size_t len); - #endif diff --git a/stage0/verbose_intern_pool.c b/stage0/verbose_intern_pool.c deleted file mode 100644 index 572f95ada4..0000000000 --- a/stage0/verbose_intern_pool.c +++ /dev/null @@ -1,13 +0,0 @@ -// verbose_intern_pool.c — C-side InternPool text dumper. -// Formats InternPool entries as text matching the Zig-side format. - -#include "verbose_intern_pool.h" -#include - -char* c_dump_intern_pool(const InternPool* ip) { - (void)ip; - // Stub: return empty string for now. - char* result = malloc(1); - if (result) result[0] = '\0'; - return result; -} diff --git a/stage0/verbose_intern_pool.h b/stage0/verbose_intern_pool.h deleted file mode 100644 index dbb3445ac1..0000000000 --- a/stage0/verbose_intern_pool.h +++ /dev/null @@ -1,11 +0,0 @@ -// verbose_intern_pool.h — C-side InternPool text dumper. -#ifndef _ZIG0_VERBOSE_INTERN_POOL_H__ -#define _ZIG0_VERBOSE_INTERN_POOL_H__ - -#include "intern_pool.h" - -// Format C InternPool as text matching the Zig-side format. -// Returns heap-allocated string. Caller frees. -char* c_dump_intern_pool(const InternPool* ip); - -#endif