[PATCH] D116261: [Clang][OpenMP] Add support for compare capture in parser

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 9 14:46:17 PST 2022

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

Comment at: clang/lib/AST/OpenMPClause.cpp:1804
+void OMPClausePrinter::VisitOMPCompareCaptureClause(OMPCompareCaptureClause *) {
+  // Do nothing as it is dummy.
ABataev wrote:
> tianshilei1992 wrote:
> > ABataev wrote:
> > > Output?
> > I did it on purpose because `OMPCompareCaptureClause` is a dummy node. When it is visited (I really doubt if it can be visited because we don't create it explicitly), it should not output any thing. `compare` and `capture` are printed when visiting the two clauses.
> Why? I see ActOnOpenMPCompareCaptureClause, which creates such nodes.
I updated those functions. They should be unreachable.

Comment at: clang/lib/Sema/SemaOpenMP.cpp:11807-11812
+    // TODO: For now we emit an error here and in emitOMPAtomicExpr we ignore
+    // code gen.
+    unsigned DiagID = Diags.getCustomDiagID(
+        DiagnosticsEngine::Error,
+        "atomic compare capture is not supported for now");
+    Diag(AtomicKindLoc, DiagID);
ABataev wrote:
> Emit in codegen
Since we are lack of Sema, putting it in Sema for now sounds more reasonable.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list