[PATCH] D115561: [Clang][OpenMP] Add the support for atomic compare in parser

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 23 17:33:57 PST 2021


tianshilei1992 marked 2 inline comments as done.
tianshilei1992 added inline comments.


================
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);
----------------
ABataev wrote:
> 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);
> 
> ```
> 
I think emitting error here sounds better because if we defer it to codegen, it's like it already passed Sema but in fact it didn't.


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