diff options
author | erichkeane <ekeane@nvidia.com> | 2025-01-22 12:22:03 -0800 |
---|---|---|
committer | erichkeane <ekeane@nvidia.com> | 2025-02-03 07:22:22 -0800 |
commit | 99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92 (patch) | |
tree | bc17fe1969c036a87d344c7c84afc4781a3c129a /clang/lib/CodeGen/CodeGenFunction.h | |
parent | cb2598dda1aae5096a77bc8a9f6679ca1b350e5e (diff) | |
download | llvm-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/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 670dfce..ced3484 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -4167,6 +4167,13 @@ public: // but in the future we will implement some sort of IR. } + void EmitOpenACCAtomicConstruct(const OpenACCAtomicConstruct &S) { + // TODO OpenACC: Implement this. It is currently implemented as a 'no-op', + // simply emitting its associated stmt, but in the future we will implement + // some sort of IR. + EmitStmt(S.getAssociatedStmt()); + } + //===--------------------------------------------------------------------===// // LValue Expression Emission //===--------------------------------------------------------------------===// |