[clang] [llvm] [Clang][OpenMP] Support expression semantics in target update fields with non-contiguous array sections (PR #176708)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 19 05:56:15 PST 2026


================
@@ -8034,11 +8034,27 @@ class MappableExprsHandler {
           if (!StrideExpr)
             return false;
 
+          assert(StrideExpr->getType()->isIntegerType() &&
+                 "Stride expression must be of integer type");
+
+          // If the stride is a variable (not a constant), it's non-contiguous.
+          const Expr *S = StrideExpr->IgnoreParenImpCasts();
+          if (const auto *DRE = dyn_cast<DeclRefExpr>(S)) {
+            if (isa<VarDecl>(DRE->getDecl()) ||
+                isa<ParmVarDecl>(DRE->getDecl()))
+              return true;
+          }
----------------
alexey-bataev wrote:

Why do you need this? StrideExpr->getIntegerConstantExpr should do this for us

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


More information about the cfe-commits mailing list