[PATCH] D123235: [OpenMP] atomic compare fail : Parser & AST support
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 16 12:53:11 PST 2023
ABataev added inline comments.
================
Comment at: clang/include/clang/AST/OpenMPClause.h:2516
+extern bool checkFailParameter(OpenMPClauseKind FailParameter);
+/// This represents 'fail' clause in the '#pragma omp atomic'
----------------
No way for extern functions. Declare in include/clang/Basic/OpenMPKinds.h
================
Comment at: clang/include/clang/AST/OpenMPClause.h:2544-2545
+
+ if (!checkFailParameter(FailParameter))
+ llvm_unreachable("Invalid fail clause parameter");
+ }
----------------
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:17707-17714
+bool clang::checkFailParameter(OpenMPClauseKind FailParameter) {
+ if (FailParameter == llvm::omp::OMPC_acquire ||
+ FailParameter == llvm::omp::OMPC_relaxed ||
+ FailParameter == llvm::omp::OMPC_seq_cst)
+ return true;
+
+ return false;
----------------
Move it to lib/Basic/OpenMPKinds.cpp
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:17721
+
+ if (!clang::checkFailParameter(Parameter)) {
+ Diag(KindLoc, diag::err_omp_atomic_fail_wrong_or_no_clauses);
----------------
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123235/new/
https://reviews.llvm.org/D123235
More information about the cfe-commits
mailing list