[PATCH] D115561: [Clang][OpenMP] Add the support for atomic compare in parser
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 23 04:51:22 PST 2021
ABataev added inline comments.
================
Comment at: clang/include/clang/AST/OpenMPClause.h:2234
+/// In this example directive '#pragma omp atomic' has 'compare' clause.
+class OMPCompareClause : public OMPClause {
+public:
----------------
`final`
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:11398-11400
+ // TODO: For now we emit an error here and in emitOMPAtomicExpr we ignore
+ // code gen.
+ Diag(Body->getBeginLoc(), diag::err_omp_atomic_compare);
----------------
Maybe emit error in codegen instead? Without adding `err_omp_atomic_compare` message in include/clang/Basic/DiagnosticSemaKinds.td, just emit emit directly there:
```
unsigned DiagID = CGM.getDiags().getCustomDiagID(
DiagnosticsEngine::Error, "atomic compare is not supported for now");
CGM.getDiags().Report(SLoc, DiagID);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115561/new/
https://reviews.llvm.org/D115561
More information about the cfe-commits
mailing list