aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>2024-06-29 09:37:32 -0500
committerGitHub <noreply@github.com>2024-06-29 09:37:32 -0500
commit0ce801f91cd79bd2f94469bdf4c48e82f2721ec1 (patch)
tree7b400e2d948c47be09ad9b842f791d8cb79a7412 /clang/lib/Sema
parent101a936bde47744084e04a64aa9af85c75d03afd (diff)
downloadllvm-0ce801f91cd79bd2f94469bdf4c48e82f2721ec1.zip
llvm-0ce801f91cd79bd2f94469bdf4c48e82f2721ec1.tar.gz
llvm-0ce801f91cd79bd2f94469bdf4c48e82f2721ec1.tar.bz2
[clang][OpenMP] Implement `isOpenMPExecutableDirective` (#97089)
What is considered "executable" in clang differs slightly from the OpenMP's "executable" category. In addition to the executable category, subsidiary directives, and OMPD_error are considered executable. Implement a function that performs that check.
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 95baaed..3e6c6c9 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -6357,6 +6357,8 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc,
OpenMPDirectiveKind PrevMappedDirective) {
+ assert(isOpenMPExecutableDirective(Kind) && "Unexpected directive category");
+
StmtResult Res = StmtError();
OpenMPBindClauseKind BindKind = OMPC_BIND_unknown;
llvm::SmallVector<OMPClause *> ClausesWithoutBind;