P5.7 Step B1: remove the compiler_call IR op + the hook Registry

The compiler_call op + #compiler hook mechanism was fully superseded by
abi(.compiler) VM-native dispatch (P5.5) — no sx code emits it anymore.

Remove: the compiler_call op variant + CompilerCall struct (inst.zig); the
Builder.compilerCall emitter (module.zig); the two dead producer blocks in
lower/call.zig (compiler_expr-bodied free fns + methods); every consumer
switch arm (emit_llvm, ops.emitCompilerCall, print, interp dispatch); the
interp.hooks field + init/deinit. Strip compiler_hooks.zig down to the still-
live BuildConfig / BuildHooks / AssetDir (delete HookError/HookFn/Registry/
registerDefaults + all hookXxx, and the now-unused interp/Value imports).

Test refs that used compiler_call as a sample unported op now use vec_splat.

501/501 unit + 706/0 corpus.
This commit is contained in:
agra
2026-06-19 16:54:38 +03:00
parent 5d25e23143
commit e2971f272c
9 changed files with 10 additions and 524 deletions

View File

@@ -494,14 +494,6 @@ pub fn lowerCall(self: *Lowering, c_in: *const ast.Call) Ref {
return self.lowerGenericCall(fd, func_name, c, args.items);
}
}
// Check for #compiler free functions
if (self.program_index.fn_ast_map.get(func_name)) |fd_check| {
if (fd_check.body.data == .compiler_expr) {
const ret_ty = if (fd_check.return_type) |rt| type_bridge.resolveAstType(rt, &self.module.types, &self.program_index.type_alias_map, &self.program_index.module_const_map) else TypeId.void;
return self.builder.compilerCall(func_name, args.items, ret_ty);
}
}
// Look up declared/extern function — try lazy lowering if not yet lowered
{
// First attempt: function may already be declared (from scanDecls)
@@ -907,17 +899,6 @@ pub fn lowerCall(self: *Lowering, c_in: *const ast.Call) Ref {
// Try direct qualified name: StructName.method
const qualified = std.fmt.allocPrint(self.alloc, "{s}.{s}", .{ sname, fa.field }) catch fa.field;
// Generic #compiler method dispatch
if (self.program_index.fn_ast_map.get(qualified)) |method_fd| {
if (method_fd.body.data == .compiler_expr) {
const ret_ty = if (method_fd.return_type) |rt|
type_bridge.resolveAstType(rt, &self.module.types, &self.program_index.type_alias_map, &self.program_index.module_const_map)
else
.void;
return self.builder.compilerCall(qualified, method_args.items, ret_ty);
}
}
// Generic-struct instance method: select the body via the
// instance's STAMPED author (CP-4), so the dispatched method is
// the one authored alongside this instance's layout — never the