You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix CABI calling convention: skip env global and escape mangled names
The CUDACABICallConv does not use a Numba environment for error-status
propagation, yet the lowering unconditionally emitted a NumbaEnv global
into every module. For lambdas this also produced invalid NVVM IR
because the CABI mangler passed raw `<lambda>` (with angle brackets)
into the global name, causing ERROR_INVALID_IR at verification.
Changes:
- Add `needs_env` class attribute to BaseCallConv (True) and override
it as False in CUDACABICallConv. Guard `emit_environment_object()`
in `BaseLower.lower()` behind this flag.
- Fix `CUDACABICallConv.mangler` to run identifiers through
`itanium_mangler.escape_string()` so characters like `<` and `>` are
hex-escaped (`_3c`, `_3e`).
- Promote `_escape_string` to public API `escape_string` (with a
backward-compatible alias) and improve its docstring.
- Add tests for `escape_string` and for CABI lambda compilation / env
omission.
Made-with: Cursor
0 commit comments