aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaExceptionSpec.cpp
diff options
context:
space:
mode:
authorerichkeane <ekeane@nvidia.com>2025-01-22 12:22:03 -0800
committererichkeane <ekeane@nvidia.com>2025-02-03 07:22:22 -0800
commit99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92 (patch)
treebc17fe1969c036a87d344c7c84afc4781a3c129a /clang/lib/Sema/SemaExceptionSpec.cpp
parentcb2598dda1aae5096a77bc8a9f6679ca1b350e5e (diff)
downloadllvm-99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92.zip
llvm-99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92.tar.gz
llvm-99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92.tar.bz2
[OpenACC] Implement Sema/AST for 'atomic' construct
The atomic construct is a particularly complicated one. The directive itself is pretty simple, it has 5 options for the 'atomic-clause'. However, the associated statement is fairly complicated. 'read' accepts: v = x; 'write' accepts: x = expr; 'update' (or no clause) accepts: x++; x--; ++x; --x; x binop= expr; x = x binop expr; x = expr binop x; 'capture' accepts either a compound statement, or: v = x++; v = x--; v = ++x; v = --x; v = x binop= expr; v = x = x binop expr; v = x = expr binop x; IF 'capture' has a compound statement, it accepts: {v = x; x binop= expr; } {x binop= expr; v = x; } {v = x; x = x binop expr; } {v = x; x = expr binop x; } {x = x binop expr ;v = x; } {x = expr binop x; v = x; } {v = x; x = expr; } {v = x; x++; } {v = x; ++x; } {x++; v = x; } {++x; v = x; } {v = x; x--; } {v = x; --x; } {x--; v = x; } {--x; v = x; } While these are all quite complicated, there is a significant amount of similarity between the 'capture' and 'update' lists, so this patch reuses a lot of the same functions. This patch implements the entirety of 'atomic', creating a new Sema file for the sema for it, as it is fairly sizable.
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r--clang/lib/Sema/SemaExceptionSpec.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp
index 7b08a06..77a1bbc 100644
--- a/clang/lib/Sema/SemaExceptionSpec.cpp
+++ b/clang/lib/Sema/SemaExceptionSpec.cpp
@@ -1425,6 +1425,7 @@ CanThrowResult Sema::canThrow(const Stmt *S) {
case Stmt::OpenACCCombinedConstructClass:
case Stmt::OpenACCDataConstructClass:
case Stmt::OpenACCHostDataConstructClass:
+ case Stmt::OpenACCAtomicConstructClass:
case Stmt::AttributedStmtClass:
case Stmt::BreakStmtClass:
case Stmt::CapturedStmtClass: