[clang] [OpenMP][clang][HIP][CUDA] fix weak alias emit on device compilation (PR #164326)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 12 07:49:49 PST 2025


================
@@ -286,6 +286,42 @@ Example Usage
       basePtr->virtualFunction(); // Allowed since obj is constructed in device code
    }
 
+Alias Attribute Support
+=======================
+
+Clang supports alias attributes in HIP code, allowing creation of alternative names for functions and variables. 
+ - Aliases work with ``__host__``, ``__device__``, and ``__host__ __device__`` functions and variables.
+ - The alias attribute uses the syntax ``__attribute__((alias("target_name")))``. Both weak and strong aliases are supported.
----------------
yxsamliu wrote:

maybe mention alias is emitted only if aliasee is emitted on the same side, otherwise it is ignored.

https://github.com/llvm/llvm-project/pull/164326


More information about the cfe-commits mailing list