diff options
Diffstat (limited to 'flang/lib/Parser')
-rw-r--r-- | flang/lib/Parser/openmp-parsers.cpp | 13 | ||||
-rw-r--r-- | flang/lib/Parser/tools.cpp | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp index d677e14..c0472ad 100644 --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -1159,6 +1159,9 @@ TYPE_PARSER( // construct<OmpDestroyClause>(Parser<OmpObject>{}))))) || "DEVICE" >> construct<OmpClause>(construct<OmpClause::Device>( parenthesized(Parser<OmpDeviceClause>{}))) || + "DEVICE_SAFESYNC" >> + construct<OmpClause>(construct<OmpClause::DeviceSafesync>( + maybe(parenthesized(scalarLogicalConstantExpr)))) || "DEVICE_TYPE" >> construct<OmpClause>(construct<OmpClause::DeviceType>( parenthesized(Parser<OmpDeviceTypeClause>{}))) || "DIST_SCHEDULE" >> @@ -1832,8 +1835,8 @@ TYPE_PARSER(sourced(construct<OpenMPDeclareMapperConstruct>( TYPE_PARSER(construct<OmpReductionCombiner>(Parser<AssignmentStmt>{}) || construct<OmpReductionCombiner>(Parser<FunctionReference>{})) -TYPE_PARSER(construct<OpenMPCriticalConstruct>( - OmpBlockConstructParser{llvm::omp::Directive::OMPD_critical})) +TYPE_PARSER(sourced(construct<OpenMPCriticalConstruct>( + OmpBlockConstructParser{llvm::omp::Directive::OMPD_critical}))) // 2.11.3 Executable Allocate directive TYPE_PARSER( @@ -1908,12 +1911,12 @@ TYPE_PARSER( Parser<OmpMetadirectiveDirective>{})) / endOmpLine)) -TYPE_PARSER(construct<OpenMPAssumeConstruct>( - sourced(OmpBlockConstructParser{llvm::omp::Directive::OMPD_assume}))) +TYPE_PARSER(sourced(construct<OpenMPAssumeConstruct>( + OmpBlockConstructParser{llvm::omp::Directive::OMPD_assume}))) // Block Construct #define MakeBlockConstruct(dir) \ - construct<OmpBlockConstruct>(OmpBlockConstructParser{dir}) + sourced(construct<OmpBlockConstruct>(OmpBlockConstructParser{dir})) TYPE_PARSER( // MakeBlockConstruct(llvm::omp::Directive::OMPD_masked) || MakeBlockConstruct(llvm::omp::Directive::OMPD_master) || diff --git a/flang/lib/Parser/tools.cpp b/flang/lib/Parser/tools.cpp index 264ca52..ed6d194 100644 --- a/flang/lib/Parser/tools.cpp +++ b/flang/lib/Parser/tools.cpp @@ -179,4 +179,9 @@ bool CheckForSingleVariableOnRHS(const AssignmentStmt &assignmentStmt) { return Unwrap<Designator>(std::get<Expr>(assignmentStmt.t)) != nullptr; } +const Name *GetDesignatorNameIfDataRef(const Designator &designator) { + const auto *dataRef{std::get_if<DataRef>(&designator.u)}; + return dataRef ? std::get_if<Name>(&dataRef->u) : nullptr; +} + } // namespace Fortran::parser |