OpenMP 5.0 metadirective
authoralokmishra.besu <>
Fri, 17 Sep 2021 21:03:01 +0000 (16:03 -0500)
committercchen <chichun.chen@hpe.com>
Fri, 17 Sep 2021 21:30:06 +0000 (16:30 -0500)
commit347f3c186d3fd86628904450d2f4ee0ffd428150
treec664e04c34d00eaed0efc0b1ad51045266d86f9a
parent7efb825382c0a8372597aaf75a319fa379573fd4
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