refactor(ffi-linkage): Phase 9.3-src — purge 'foreign' from src/ comments + a user-facing diagnostic
Reword every 'foreign' comment to the extern/runtime-class vocabulary matching the renamed identifiers (foreign call→extern call, foreign class→runtime class, foreign path→runtime path, the #foreign-literal comment mentions → extern, etc.). Also fixes two USER-FACING issues: the 'expected … #foreign … after type annotation' parse error no longer advertises the removed keyword, and the Android 'no #jni_main' help diagnostic now shows '#jni_class(…) extern' instead of the rejected '#foreign #jni_class'. Removed the now-dead prefix-#foreign-vs-postfix conflict branch in parseRuntimeClassDecl (the caller rejects #foreign before it runs). src/ now contains 'foreign' ONLY in the hash_foreign token machinery + its 4 rejection messages — the deprecation mechanism (kept per the 9.0 recommendation; the message MUST name #foreign to guide migration). Snapshot-neutral; suite green (646 corpus / 444 unit, 0 failed).
This commit is contained in:
@@ -485,7 +485,7 @@ pub const Ops = struct {
|
||||
pub fn emitObjcMsgSend(self: Ops, instruction: *const Inst, msg: ObjcMsgSend) void {
|
||||
const msg_send = self.e.getObjcMsgSendValue();
|
||||
// Detect the sret case: >16 B non-HFA struct return.
|
||||
// Same predicate as the plain-foreign-call path so the
|
||||
// Same predicate as the plain-extern-call path so the
|
||||
// two arms stay in lockstep.
|
||||
const raw_ret_ty = self.e.toLLVMType(instruction.ty);
|
||||
const uses_sret = self.e.needsByval(instruction.ty, raw_ret_ty);
|
||||
@@ -516,7 +516,7 @@ pub const Ops = struct {
|
||||
call_args[sret_off + 1] = self.e.coerceArg(self.e.resolveRef(msg.sel), self.e.cached_ptr);
|
||||
// additional args take their IR types, with ABI
|
||||
// coercion applied so structs / strings decay the
|
||||
// same way they do for any C foreign call.
|
||||
// same way they do for any C extern call.
|
||||
for (msg.args, 0..) |arg_ref, i| {
|
||||
const raw_ty = self.e.argIRTypeOrFail(arg_ref);
|
||||
const raw_llvm = self.e.toLLVMType(raw_ty);
|
||||
|
||||
Reference in New Issue
Block a user