diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp index a8f2f0056fe4a..8ab9905123135 100644 --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -1281,6 +1281,16 @@ TYPE_PARSER(sourced(construct( // --- Parsers for directives and constructs -------------------------- +static inline constexpr auto IsDirective(llvm::omp::Directive dir) { + return [dir](const OmpDirectiveName &name) -> bool { return dir == name.v; }; +} + +static inline constexpr auto IsMemberOf(const DirectiveSet &dirs) { + return [&dirs](const OmpDirectiveName &name) -> bool { + return dirs.test(llvm::to_underlying(name.v)); + }; +} + TYPE_PARSER(sourced(construct(OmpDirectiveNameParser{}))) OmpDirectiveSpecification static makeFlushFromOldSyntax(Verbatim &&text, @@ -1366,16 +1376,6 @@ TYPE_PARSER(sourced(construct( TYPE_PARSER(sourced(construct( verbatim("METADIRECTIVE"_tok), Parser{}))) -static inline constexpr auto IsDirective(llvm::omp::Directive dir) { - return [dir](const OmpDirectiveName &name) -> bool { return dir == name.v; }; -} - -static inline constexpr auto IsMemberOf(const DirectiveSet &dirs) { - return [&dirs](const OmpDirectiveName &name) -> bool { - return dirs.test(llvm::to_underlying(name.v)); - }; -} - struct OmpBeginDirectiveParser { using resultType = OmpDirectiveSpecification;