[clang] [Clang][OpenMP]Default clause variable category (PR #157063)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 11 08:42:54 PDT 2025


================
@@ -1326,11 +1365,33 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(const_iterator &Iter,
     return DVar;
   }
 
+  DefaultDataSharingAttributes IterDA = Iter->DefaultAttr;
+  switch (Iter->DefaultVCAttr) {
+  case DSA_VC_aggregate:
+    if (!VD->getType()->isAggregateType())
+      IterDA = DSA_none;
+    break;
+  case DSA_VC_allocatable:
+    if (!(VD->getType()->isPointerType() ||
+          VD->getType()->isVariableArrayType()))
+      IterDA = DSA_none;
+    break;
+  case DSA_VC_pointer:
+    if (!VD->getType()->isPointerType())
+      IterDA = DSA_none;
+    break;
+  case DSA_VC_scalar:
+    if (!VD->getType()->isScalarType())
+      IterDA = DSA_none;
+    break;
+  default:;
----------------
alexey-bataev wrote:

```suggestion
  case DSA_VC_all:
    break;
```


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


More information about the cfe-commits mailing list