Skip to content

Commit 24b03d3

Browse files
authored
[flang][OpenMP] Move helper functions further up the file, NFC (llvm#159803)
Move them to before any potential users.
1 parent ffb70b0 commit 24b03d3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

flang/lib/Parser/openmp-parsers.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,16 @@ TYPE_PARSER(sourced(construct<OmpErrorDirective>(
12811281

12821282
// --- Parsers for directives and constructs --------------------------
12831283

1284+
static inline constexpr auto IsDirective(llvm::omp::Directive dir) {
1285+
return [dir](const OmpDirectiveName &name) -> bool { return dir == name.v; };
1286+
}
1287+
1288+
static inline constexpr auto IsMemberOf(const DirectiveSet &dirs) {
1289+
return [&dirs](const OmpDirectiveName &name) -> bool {
1290+
return dirs.test(llvm::to_underlying(name.v));
1291+
};
1292+
}
1293+
12841294
TYPE_PARSER(sourced(construct<OmpDirectiveName>(OmpDirectiveNameParser{})))
12851295

12861296
OmpDirectiveSpecification static makeFlushFromOldSyntax(Verbatim &&text,
@@ -1366,16 +1376,6 @@ TYPE_PARSER(sourced(construct<OpenMPUtilityConstruct>(
13661376
TYPE_PARSER(sourced(construct<OmpMetadirectiveDirective>(
13671377
verbatim("METADIRECTIVE"_tok), Parser<OmpClauseList>{})))
13681378

1369-
static inline constexpr auto IsDirective(llvm::omp::Directive dir) {
1370-
return [dir](const OmpDirectiveName &name) -> bool { return dir == name.v; };
1371-
}
1372-
1373-
static inline constexpr auto IsMemberOf(const DirectiveSet &dirs) {
1374-
return [&dirs](const OmpDirectiveName &name) -> bool {
1375-
return dirs.test(llvm::to_underlying(name.v));
1376-
};
1377-
}
1378-
13791379
struct OmpBeginDirectiveParser {
13801380
using resultType = OmpDirectiveSpecification;
13811381

0 commit comments

Comments
 (0)