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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to