[OpenMP] Add variant extension that applies to declarations
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 29 Jun 2022 18:53:45 +0000 (14:53 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 29 Jun 2022 19:04:26 +0000 (15:04 -0400)
commitf892ddb3be640f477fc9acef55e7bd613fc27acf
tree0ddd29e3e24927b0bf5d0ad77b739ba51861960f
parent0bdaef38c9bbb4986709057b14dd5a70e8975051
[OpenMP] Add variant extension that applies to declarations

This patch adds a new extension to the `omp begin / end declare variant`
support that causes it to apply to function declarations as well. This
is explicitly not done in the standard, but can be useful in some
situations so we should provide it as an extension. This will allow us
to uniquely bind and overload existing definitions with a simple
declaration using variants.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D124624
clang/include/clang/Basic/AttrDocs.td
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/OpenMP/declare_variant_bind_to_decl.cpp [new file with mode: 0644]
llvm/include/llvm/Frontend/OpenMP/OMPKinds.def