[PATCH] D98558: [OPENMP51]Initial support for the interop directive

Mike Rice via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 12 14:40:37 PST 2021


mikerice created this revision.
mikerice added reviewers: jdoerfert, ABataev, RaviNarayanaswamy.
Herald added subscribers: dexonsmith, martong, arphaman, guansong, yaxunl.
mikerice requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

Adds basic parsing/sema/serialization support for the #pragma omp interop directive.

Nothing too unusual here.  Some points to consider:

1. A 'destroy' clause already exists that differs from 'destroy' used on 'interop' that uses a variable.  This results in a nullptr for the variable when that type of 'destroy'.

2. There wasn't a clearly good way to represent the 'init' clause.  It has one Expr for the variable followed by an optional list of int/string Exprs so requires a TrailingExprList.  I used an OMPVarListClause since it provides the functionality of trailing Exprs it doesn't really contain a 'varlist'.  It didn't seem worth it to roll my own with almost the exact same functionality or rename OMPVarListClause but am open to ideas.

3. I didn't do any validation of the preference-list yet.  Since implementation-defined values are allowed and different implementations might only support some of the known values we might want to give a) warning for known but unsupported values and/or b) warning for completely unknown values.  Or maybe warn anytime an implementation doesn't support a value.  Should these value be hardcoded in the compiler at all?  Or just determined from the headers?


https://reviews.llvm.org/D98558

Files:
  clang/include/clang-c/Index.h
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/AST/StmtOpenMP.h
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Basic/StmtNodes.td
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/lib/AST/OpenMPClause.cpp
  clang/lib/AST/StmtOpenMP.cpp
  clang/lib/AST/StmtPrinter.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/Parse/ParseOpenMP.cpp
  clang/lib/Sema/SemaExceptionSpec.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTReaderStmt.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/lib/Serialization/ASTWriterStmt.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
  clang/test/OpenMP/interop_ast_print.cpp
  clang/test/OpenMP/interop_messages.cpp
  clang/test/OpenMP/taskgroup_messages.cpp
  clang/tools/libclang/CIndex.cpp
  clang/tools/libclang/CXCursor.cpp
  llvm/include/llvm/Frontend/OpenMP/OMP.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98558.330368.patch
Type: text/x-patch
Size: 64350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210312/25f1f2c0/attachment.bin>


More information about the llvm-commits mailing list