[OpenMP] `omp begin/end declare variant` - part 1, parsing
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 21 Feb 2020 01:50:47 +0000 (19:50 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Fri, 27 Mar 2020 07:30:58 +0000 (02:30 -0500)
commit095cecbe0ded16f2e66435d938fdc3cb1869713f
tree867e67680417a7d97492d8120b14753123bd387c
parentb29322435abd9aa802ccc68a57f89cb068ff8526
[OpenMP] `omp begin/end declare variant` - part 1, parsing

This is the first part extracted from D71179 and cleaned up.

This patch provides parsing support for `omp begin/end declare variant`,
as defined in OpenMP technical report 8 (TR8) [0].

A major purpose of this patch is to provide proper math.h/cmath support
for OpenMP target offloading. See PR42061, PR42798, PR42799. The current
code was developed with this feature in mind, see [1].

[0] https://www.openmp.org/wp-content/uploads/openmp-TR8.pdf
[1] https://reviews.llvm.org/D61399#change-496lQkg0mhRN

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D74941
16 files changed:
clang/include/clang/AST/OpenMPClause.h
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/AST/OpenMPClause.cpp
clang/lib/Basic/OpenMPKinds.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/AST/ast-dump-openmp-begin-declare-variant.c [new file with mode: 0644]
clang/test/OpenMP/begin-declare-variant_no_end_for_matching_selector.c [new file with mode: 0644]
clang/test/OpenMP/begin_declare_variant_messages.c [new file with mode: 0644]
clang/test/OpenMP/declare_variant_messages.c
clang/test/OpenMP/declare_variant_messages.cpp
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
llvm/lib/Frontend/OpenMP/OMPContext.cpp