commit 905ea3a3f756ee2f7fe767c7760d039f5c744237 (tree)
parent 1ed1e8ddfcb8f532cf5d42d733423ea8ae1fddfd
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date: Thu, 19 Feb 2026 18:32:46 +0000
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 <noreply@anthropic.com>
Diffstat:
6 files changed, 2 insertions(+), 61 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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
@@ -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 <stdlib.h>
-
-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
@@ -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