ApplyIndirect Closure Ownership Model
3 sections
Overview
Fix the architectural gap where ApplyIndirect/InvokeIndirect (indirect calls through closures) lack per-argument ownership semantics. Currently, Apply/Invoke carry arg_ownership that tells the AIMS system whether the caller or callee manages RC cleanup, but ApplyIndirect/InvokeIndirect have no such field. This forces an inconsistent hybrid: the caller always emits RcDec for indirect call arguments, but PartialApply inside the callee uses ownership transfer semantics (suppresses callee-side RcDec). The result is double-drop or RC leak for every closure that captures an argument passed through ApplyIndirect.
Completed
3 sections
ARC IR Shape
Add arg_ownership fields to ApplyIndirect and InvokeIndirect, update all IR queries and utilities
Ownership Propagation
Populate arg_ownership on ApplyIndirect/InvokeIndirect from closure contracts via the AIMS pipeline
LLVM Cleanup & Verification
Replace LLVM-level workarounds with arg_ownership logic, add InvokeIndirect handling (drop_hints + unwind_cleanup), verify env drop correctness, remove unused _capture_ownership parameter, fix 3 stale docs, un-ignore tests, verify zero leaks