diff options
author | Ethan Luis McDonough <ethanluismcdonough@gmail.com> | 2023-05-10 14:50:41 -0500 |
---|---|---|
committer | Ethan Luis McDonough <ethanluismcdonough@gmail.com> | 2023-05-10 14:57:20 -0500 |
commit | 6311ab21474a0f3e0340515185cd1d6e33a9892a (patch) | |
tree | b1724dbcccfe7ca73b13f96dbbfb0c1a58f083f2 /flang/examples | |
parent | 845e72eb78e8292d87a4f8192cefc27ecab65c01 (diff) | |
download | llvm-6311ab21474a0f3e0340515185cd1d6e33a9892a.tar.gz |
[Flang] Syntax support for OMP Allocators Construct
OpenMP 5.2 introduces a Fortran specific construct that aims to replace the executable allocate directive. This patch seeks to add parser support for the directive as well as the allocator clause with the [[ https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf#section.6.6 | extended align/complex ]] modifier.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D149727
Diffstat (limited to 'flang/examples')
-rw-r--r-- | flang/examples/FeatureList/FeatureList.cpp | 7 | ||||
-rw-r--r-- | flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/flang/examples/FeatureList/FeatureList.cpp b/flang/examples/FeatureList/FeatureList.cpp index 5efda806856f..a93c1b19ea68 100644 --- a/flang/examples/FeatureList/FeatureList.cpp +++ b/flang/examples/FeatureList/FeatureList.cpp @@ -474,6 +474,7 @@ public: READ_FEATURE(OmpDependenceType::Type) READ_FEATURE(OmpDependSinkVec) READ_FEATURE(OmpDependSinkVecLength) + READ_FEATURE(OmpEndAllocators) READ_FEATURE(OmpEndAtomic) READ_FEATURE(OmpEndBlockDirective) READ_FEATURE(OmpEndCriticalDirective) @@ -506,7 +507,10 @@ public: READ_FEATURE(OmpReductionInitializerClause) READ_FEATURE(OmpReductionOperator) READ_FEATURE(OmpAllocateClause) - READ_FEATURE(OmpAllocateClause::Allocator) + READ_FEATURE(OmpAllocateClause::AllocateModifier) + READ_FEATURE(OmpAllocateClause::AllocateModifier::Allocator) + READ_FEATURE(OmpAllocateClause::AllocateModifier::ComplexModifier) + READ_FEATURE(OmpAllocateClause::AllocateModifier::Align) READ_FEATURE(OmpScheduleClause) READ_FEATURE(OmpScheduleClause::ScheduleType) READ_FEATURE(OmpDeviceClause) @@ -553,6 +557,7 @@ public: READ_FEATURE(OpenMPFlushConstruct) READ_FEATURE(OpenMPLoopConstruct) READ_FEATURE(OpenMPExecutableAllocate) + READ_FEATURE(OpenMPAllocatorsConstruct) READ_FEATURE(OpenMPRequiresConstruct) READ_FEATURE(OpenMPSimpleStandaloneConstruct) READ_FEATURE(OpenMPStandaloneConstruct) diff --git a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp index d78f898d499e..7382e99de1ab 100644 --- a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp +++ b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp @@ -128,6 +128,10 @@ std::string OpenMPCounterVisitor::getName(const OpenMPConstruct &c) { const CharBlock &source{std::get<0>(c.t).source}; return normalize_construct_name(source.ToString()); }, + [&](const OpenMPAllocatorsConstruct &c) -> std::string { + const CharBlock &source{std::get<0>(c.t).source}; + return normalize_construct_name(source.ToString()); + }, [&](const OpenMPAtomicConstruct &c) -> std::string { return std::visit( [&](const auto &c) { |