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

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 5 07:48:44 PST 2025


================
@@ -4043,6 +4043,53 @@ template <typename AttrT> static bool hasImplicitAttr(const ValueDecl *D) {
   return D->isImplicit();
 }
 
+static bool shouldSkipAliasEmission(const CodeGenModule &CGM,
+                                    const ValueDecl *Global) {
+  const LangOptions &LangOpts = CGM.getLangOpts();
+  if (!(LangOpts.OpenMPIsTargetDevice || LangOpts.CUDA))
+    return false;
----------------
jhuber6 wrote:

```suggestion
  if (!LangOpts.OpenMPIsTargetDevice && !LangOpts.CUDA))
    return false;
```
Clearer.

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


More information about the cfe-commits mailing list