OpenMP 5.0 metadirective
authoralokmishra.besu <>
Fri, 17 Sep 2021 21:03:01 +0000 (16:03 -0500)
committercchen <chichun.chen@hpe.com>
Sat, 18 Sep 2021 18:40:44 +0000 (13:40 -0500)
commit000875c127c7f2ae10a954bd592c1658e5912cf1
treee21183dd69cc1a303ca2d1cd7a791776555d6b7a
parentd841c72e09c81a5892a52e3c3200af838f6a2a69
OpenMP 5.0 metadirective

This patch supports OpenMP 5.0 metadirective features.
It is implemented keeping the OpenMP 5.1 features like dynamic user condition in mind.

A new function, getBestWhenMatchForContext, is defined in llvm/Frontend/OpenMP/OMPContext.h

Currently this function return the index of the when clause with the highest score from the ones applicable in the Context.
But this function is declared with an array which can be used in OpenMP 5.1 implementation to select all the valid when clauses which can be resolved in runtime. Currently this array is set to null by default and its implementation is left for future.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D91944
35 files changed:
clang/include/clang-c/Index.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/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/Basic/OpenMPKinds.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGStmt.cpp
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaExceptionSpec.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
clang/test/OpenMP/metadirective_ast_print.c [new file with mode: 0644]
clang/test/OpenMP/metadirective_device_kind_codegen.c [new file with mode: 0644]
clang/test/OpenMP/metadirective_device_kind_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/metadirective_empty.cpp [new file with mode: 0644]
clang/test/OpenMP/metadirective_implementation_codegen.c [new file with mode: 0644]
clang/test/OpenMP/metadirective_implementation_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/metadirective_messages.cpp [new file with mode: 0644]
clang/tools/libclang/CIndex.cpp
clang/tools/libclang/CXCursor.cpp
flang/lib/Semantics/check-omp-structure.cpp
llvm/include/llvm/Frontend/OpenMP/OMP.td