diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-06-29 14:53:45 -0400 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2022-06-29 15:04:26 -0400 |
commit | f892ddb3be640f477fc9acef55e7bd613fc27acf (patch) | |
tree | 0ddd29e3e24927b0bf5d0ad77b739ba51861960f /clang/lib/Parse/ParseOpenMP.cpp | |
parent | 0bdaef38c9bbb4986709057b14dd5a70e8975051 (diff) | |
download | llvm-f892ddb3be640f477fc9acef55e7bd613fc27acf.zip llvm-f892ddb3be640f477fc9acef55e7bd613fc27acf.tar.gz llvm-f892ddb3be640f477fc9acef55e7bd613fc27acf.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 7457886..de4a25c 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -960,6 +960,10 @@ static bool checkExtensionProperty(Parser &P, SourceLocation Loc, TraitProperty::implementation_extension_allow_templates) return true; + if (TIProperty.Kind == + TraitProperty::implementation_extension_bind_to_declaration) + return true; + auto IsMatchExtension = [](OMPTraitProperty &TP) { return (TP.Kind == llvm::omp::TraitProperty::implementation_extension_match_all || |