aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ComputeDependence.cpp
diff options
context:
space:
mode:
authorErich Keane <ekeane@nvidia.com>2024-04-25 10:22:03 -0700
committerGitHub <noreply@github.com>2024-04-25 10:22:03 -0700
commit39adc8f423297c5741bb731bb8b1e545d558502c (patch)
tree4112878bc2fa3ed08d5644644e72e867b7505e86 /clang/lib/AST/ComputeDependence.cpp
parent8dc7db7a24633f55ef28f2ab4b379386a34505f8 (diff)
downloadllvm-39adc8f423297c5741bb731bb8b1e545d558502c.zip
llvm-39adc8f423297c5741bb731bb8b1e545d558502c.tar.gz
llvm-39adc8f423297c5741bb731bb8b1e545d558502c.tar.bz2
[NFC] Generalize ArraySections to work for OpenACC in the future (#89639)
OpenACC is going to need an array sections implementation that is a simpler version/more restrictive version of the OpenMP version. This patch moves `OMPArraySectionExpr` to `Expr.h` and renames it `ArraySectionExpr`, then adds an enum to choose between the two. This also fixes a couple of 'drive-by' issues that I discovered on the way, but leaves the OpenACC Sema parts reasonably unimplemented (no semantic analysis implementation), as that will be a followup patch.
Diffstat (limited to 'clang/lib/AST/ComputeDependence.cpp')
-rw-r--r--clang/lib/AST/ComputeDependence.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/ComputeDependence.cpp b/clang/lib/AST/ComputeDependence.cpp
index 5ec3013..bad8e75 100644
--- a/clang/lib/AST/ComputeDependence.cpp
+++ b/clang/lib/AST/ComputeDependence.cpp
@@ -443,12 +443,17 @@ ExprDependence clang::computeDependence(ObjCIndirectCopyRestoreExpr *E) {
return E->getSubExpr()->getDependence();
}
-ExprDependence clang::computeDependence(OMPArraySectionExpr *E) {
+ExprDependence clang::computeDependence(ArraySectionExpr *E) {
auto D = E->getBase()->getDependence();
if (auto *LB = E->getLowerBound())
D |= LB->getDependence();
if (auto *Len = E->getLength())
D |= Len->getDependence();
+
+ if (E->isOMPArraySection()) {
+ if (auto *Stride = E->getStride())
+ D |= Stride->getDependence();
+ }
return D;
}