refactor(ffi-linkage): Phase 9.1a — rename collision-free linkage identifiers

Mechanical src/ rename of the linkage-family identifiers whose extern_* target is
collision-free: callForeign→callExtern, marshalForeignArg→marshalExternArg,
dedupeForeignSymbol→dedupeExternSymbol, foreign_name_map→extern_name_map,
is_foreign_c_api→is_extern_c_api. Snapshot-neutral (internal only); suite green
(646 corpus / 444 unit, 0 failed).

Deferred (need per-site analysis — target name already exists): is_foreign↔is_extern
(38 existing), foreign_lib/foreign_name↔extern_lib/extern_name (15/16 existing),
foreign_expr (still built by c_import.zig auto-synthesis). Runtime-class family
(ForeignClassDecl etc. → Runtime*, Decision 5) is Phase 9.2.
This commit is contained in:
agra
2026-06-15 08:39:59 +03:00
parent 7ca074e1b0
commit b838f6383f
8 changed files with 25 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ pub const AbiLowering = struct {
}
/// Same as `abiCoerceParamType` but with an explicit
/// `is_foreign_c_api` knob. When true, sx `string` / `[]T` slices
/// `is_extern_c_api` knob. When true, sx `string` / `[]T` slices
/// collapse to `ptr` — the libc convention where the user writes
/// `string` to mean `char *` and the length is dropped. When
/// false (sx-internal `callconv(.c)` like block trampolines), the
@@ -37,8 +37,8 @@ pub const AbiLowering = struct {
/// `(*Block, string) -> void callconv(.c)` fn-pointer mismatched
/// the caller's `{ptr, i64}` value against the trampoline's
/// collapsed `ptr` param.
pub fn abiCoerceParamTypeEx(self: AbiLowering, ir_ty: TypeId, llvm_ty: c.LLVMTypeRef, is_foreign_c_api: bool) c.LLVMTypeRef {
if (is_foreign_c_api) {
pub fn abiCoerceParamTypeEx(self: AbiLowering, ir_ty: TypeId, llvm_ty: c.LLVMTypeRef, is_extern_c_api: bool) c.LLVMTypeRef {
if (is_extern_c_api) {
if (ir_ty == .string) return self.e.cached_ptr;
if (!ir_ty.isBuiltin()) {
const info = self.e.ir_mod.types.get(ir_ty);