aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaOpenACC.cpp
diff options
context:
space:
mode:
authorerichkeane <ekeane@nvidia.com>2024-12-16 06:27:59 -0800
committererichkeane <ekeane@nvidia.com>2024-12-16 06:44:53 -0800
commit1ab81f8e7f77110c4a752dd7d2cc39fb5148760c (patch)
tree0e72a4849736e53545c0e03c519fc4db53f2f6d2 /clang/lib/Sema/SemaOpenACC.cpp
parent8380bafaed84cb5799feef70bf34387d6f15acff (diff)
downloadllvm-1ab81f8e7f77110c4a752dd7d2cc39fb5148760c.zip
llvm-1ab81f8e7f77110c4a752dd7d2cc39fb5148760c.tar.gz
llvm-1ab81f8e7f77110c4a752dd7d2cc39fb5148760c.tar.bz2
[OpenACC] Implement 'delete' AST/Sema for 'exit data' construct
'delete' is another clause that has very little compile-time implication, but needs a full AST that takes a var list. This patch ipmlements it fully, plus adds sufficient test coverage.
Diffstat (limited to 'clang/lib/Sema/SemaOpenACC.cpp')
-rw-r--r--clang/lib/Sema/SemaOpenACC.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenACC.cpp b/clang/lib/Sema/SemaOpenACC.cpp
index 7156e37..7af209aa 100644
--- a/clang/lib/Sema/SemaOpenACC.cpp
+++ b/clang/lib/Sema/SemaOpenACC.cpp
@@ -425,6 +425,15 @@ bool doesClauseApplyToDirective(OpenACCDirectiveKind DirectiveKind,
return false;
}
}
+ case OpenACCClauseKind::Delete: {
+ switch (DirectiveKind) {
+ case OpenACCDirectiveKind::ExitData:
+ return true;
+ default:
+ return false;
+ }
+ }
+
case OpenACCClauseKind::Detach: {
switch (DirectiveKind) {
case OpenACCDirectiveKind::ExitData:
@@ -1066,6 +1075,17 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitDetachClause(
Clause.getEndLoc());
}
+OpenACCClause *SemaOpenACCClauseVisitor::VisitDeleteClause(
+ SemaOpenACC::OpenACCParsedClause &Clause) {
+ // ActOnVar ensured that everything is a valid variable reference, so there
+ // really isn't anything to do here. GCC does some duplicate-finding, though
+ // it isn't apparent in the standard where this is justified.
+ return OpenACCDeleteClause::Create(Ctx, Clause.getBeginLoc(),
+ Clause.getLParenLoc(), Clause.getVarList(),
+ Clause.getEndLoc());
+}
+
+
OpenACCClause *SemaOpenACCClauseVisitor::VisitDevicePtrClause(
SemaOpenACC::OpenACCParsedClause &Clause) {
// Restrictions only properly implemented on 'compute'/'combined'/'data'