refactor(ffi-linkage): Phase 9.2b — rename runtime-class fns + state → runtime_* / is_reference
The runtime-class object-model identifiers (Decision 5): parse/lower/find/resolve/ register/stamp fns Foreign→Runtime (parseRuntimeClassDecl, lowerRuntimeMethodCall, findRuntimeMethodInChain, resolveRuntimeMethodReturnType, registerRuntimeClassDecl, runtimeClassStructType, runtimeKindForOffset, …); state foreign_class_map→ runtime_class_map, current_foreign_class/_method→current_runtime_*, the foreign_class_decl union variant→runtime_class_decl, foreign_method/static/instance/ class→runtime_*; and the reference-vs-define flag is_foreign→is_reference (+ is_foreign_eff→is_reference_eff) now that it only lives on RuntimeClassDecl. Snapshot-neutral; suite green (646/444). Remaining 9.2: the foreign_path family (coupled .sx hooks: jni_main_foreign_path_at spans build.sx/bundle.sx/compiler_hooks.zig/specs.md) + the extern-ref validators (checkForeignRefs etc. → Extern, linkage not runtime) + bare 'foreign' comments.
This commit is contained in:
@@ -179,7 +179,7 @@ pub const ObjcLowering = struct {
|
||||
const is_objc_obj = blk: {
|
||||
if (pointee_info != .@"struct") break :blk false;
|
||||
const name = self.l.module.types.getString(pointee_info.@"struct".name);
|
||||
break :blk self.l.program_index.foreign_class_map.get(name) != null;
|
||||
break :blk self.l.program_index.runtime_class_map.get(name) != null;
|
||||
};
|
||||
if (is_objc_obj) {
|
||||
try out.append(self.l.alloc, '@');
|
||||
@@ -319,7 +319,7 @@ pub const ObjcLowering = struct {
|
||||
const pointee_info = self.l.module.types.get(ptr_info.pointer.pointee);
|
||||
if (pointee_info != .@"struct") return false;
|
||||
const struct_name = self.l.module.types.getString(pointee_info.@"struct".name);
|
||||
const fcd = self.l.program_index.foreign_class_map.get(struct_name) orelse return false;
|
||||
const fcd = self.l.program_index.runtime_class_map.get(struct_name) orelse return false;
|
||||
return fcd.runtime == .objc_class or fcd.runtime == .objc_protocol;
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ pub const ObjcLowering = struct {
|
||||
const pointee_info = self.l.module.types.get(pointee);
|
||||
if (pointee_info != .@"struct") break :blk false;
|
||||
const struct_name = self.l.module.types.getString(pointee_info.@"struct".name);
|
||||
const fcd = self.l.program_index.foreign_class_map.get(struct_name) orelse break :blk false;
|
||||
const fcd = self.l.program_index.runtime_class_map.get(struct_name) orelse break :blk false;
|
||||
break :blk fcd.runtime == .objc_class or fcd.runtime == .objc_protocol;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user