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>
This commit is contained in:
2026-02-19 18:32:46 +00:00
parent e275e9bb76
commit 882ad78257
6 changed files with 2 additions and 61 deletions

View File

@@ -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",

View File

@@ -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,

View File

@@ -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 };
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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