Skip to content

Commit e24a212

Browse files
[clang][OpenMP] Shorten directive classification in ParseOpenMP (#94691)
Use directive categories to simplify long lists of `case` statements in the OpenMP parser. This is a step towards avoiding dependence on explicitly specified sets of directives that can be expressed more generically. The upcoming OpenMP 6.0 will introduce many new combined directives, and the more generically we handle directives, the easier the introduction of the new standard will be. --------- Co-authored-by: Alexey Bataev <[email protected]>
1 parent 85f47fd commit e24a212

File tree

2 files changed

+224
-314
lines changed

2 files changed

+224
-314
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,19 @@ class Parser : public CodeCompletionHandler {
35113511
/// metadirective and therefore ends on the closing paren.
35123512
StmtResult ParseOpenMPDeclarativeOrExecutableDirective(
35133513
ParsedStmtContext StmtCtx, bool ReadDirectiveWithinMetadirective = false);
3514+
3515+
/// Parses executable directive.
3516+
///
3517+
/// \param StmtCtx The context in which we're parsing the directive.
3518+
/// \param DKind The kind of the executable directive.
3519+
/// \param Loc Source location of the beginning of the directive.
3520+
/// \param ReadDirectiveWithinMetadirective true if directive is within a
3521+
/// metadirective and therefore ends on the closing paren.
3522+
StmtResult
3523+
ParseOpenMPExecutableDirective(ParsedStmtContext StmtCtx,
3524+
OpenMPDirectiveKind DKind, SourceLocation Loc,
3525+
bool ReadDirectiveWithinMetadirective);
3526+
35143527
/// Parses clause of kind \a CKind for directive of a kind \a Kind.
35153528
///
35163529
/// \param DKind Kind of current directive.

0 commit comments

Comments
 (0)