Nick Sarnie 50a5462b2c
[CodeGen] Fix C++ global dtor for non-zero program AS targets (#186484)
In codegen for C++ global destructors, we pass a pointer to the
destructor to be called at program exit as the first arg to the
`__cxa_atexit` function.

If the target's default program AS and default AS are not equal, we need
to emit an addrspacecast from the program AS to the generic AS (which is
used as the argument type for the first arg of `__cxa_atexit`) in the
function call.

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-03-16 14:09:38 +00:00
..