Files
clang-p2996/clang/test/CodeGenCXX/template-param-objects-address-space.cpp
Alex Voicu 57a0416e0e [clang][CodeGen] Handle template parameter objects with explicit address spaces (#69266)
For certain cases (e.g. when their address is observable at run time) it
is necessary to provide physical backing for non-type template parameter
objects. Said backing comes in the form of a global variable. For
certain targets (e.g. AMDGPU), which use a non-default address space for
globals, this can lead to an issue when referencing said global in
address space agnostic languages (such as HIP), for example when passing
them to a function.

This patch addresses this issue by inserting an address space cast iff
there is an address space mismatch between the type of a reference
expression and the address space of the backing global. A test is also
added.
2023-11-29 00:15:18 +00:00

1.7 KiB