[flang] [llvm] [flang] Add special genre for allocatable and pointer device component (PR #157731)

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 11:42:49 PDT 2025


================
@@ -225,6 +225,16 @@ inline bool HasCUDAAttr(const Symbol &sym) {
 
 bool HasCUDAComponent(const Symbol &sym);
 
+inline bool IsCUDADevice(const Symbol &sym) {
+  if (const auto *details{sym.GetUltimate().detailsIf<ObjectEntityDetails>()}) {
+    if (details->cudaDataAttr() &&
----------------
klausler wrote:

`return details->cudaDataAttr() && *details->cudaDataAttr() == common::CUDADataAttr::Device;` seems less clunky.

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


More information about the llvm-commits mailing list