[all-commits] [llvm/llvm-project] 99a913: [OpenACC] Implement Sema/AST for 'atomic' construct

Erich Keane via All-commits all-commits at lists.llvm.org
Mon Feb 3 07:24:20 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92
      https://github.com/llvm/llvm-project/commit/99a9133a68b77cb978dd4b0cdbcd67e4edf7bd92
  Author: erichkeane <ekeane at nvidia.com>
  Date:   2025-02-03 (Mon, 03 Feb 2025)

  Changed paths:
    M clang/include/clang-c/Index.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/AST/StmtOpenACC.h
    M clang/include/clang/AST/TextNodeDumper.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/OpenACCKinds.h
    M clang/include/clang/Basic/StmtNodes.td
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/SemaOpenACC.h
    M clang/include/clang/Serialization/ASTBitCodes.h
    M clang/lib/AST/StmtOpenACC.cpp
    M clang/lib/AST/StmtPrinter.cpp
    M clang/lib/AST/StmtProfile.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Parse/ParseOpenACC.cpp
    M clang/lib/Sema/CMakeLists.txt
    M clang/lib/Sema/SemaExceptionSpec.cpp
    M clang/lib/Sema/SemaOpenACC.cpp
    A clang/lib/Sema/SemaOpenACCAtomic.cpp
    M clang/lib/Sema/SemaOpenACCClause.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReaderStmt.cpp
    M clang/lib/Serialization/ASTWriterStmt.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    A clang/test/AST/ast-print-openacc-atomic-construct.cpp
    M clang/test/ParserOpenACC/parse-constructs.c
    A clang/test/SemaOpenACC/atomic-construct-ast.cpp
    A clang/test/SemaOpenACC/atomic-construct.cpp
    M clang/tools/libclang/CIndex.cpp
    M clang/tools/libclang/CXCursor.cpp

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list