================
@@ -48,29 +70,35 @@ CIRGenFunction::emitOMPParallelDirective(const 
OMPParallelDirective &s) {
 
   auto parallelOp = mlir::omp::ParallelOp::create(builder, begin, clauseOps);
 
-  {
-    mlir::Block &block = parallelOp.getRegion().emplaceBlock();
-    mlir::OpBuilder::InsertionGuard guardCase(builder);
-    builder.setInsertionPointToEnd(&block);
+  mlir::Block &block = parallelOp.getRegion().emplaceBlock();
+  mlir::OpBuilder::InsertionGuard guard(builder);
+  builder.setInsertionPointToEnd(&block);
 
-    LexicalScope ls{*this, begin, builder.getInsertionBlock()};
+  CIRGenFunction::LexicalScope ls{cgf, begin, builder.getInsertionBlock()};
+
+  if (s.hasCancel())
+    cgm.errorNYI(s.getBeginLoc(), "OpenMP Parallel with Cancel");
----------------
skatrak wrote:

I just noticed that `cgm.errorNYI` doesn't immediately exit the application, 
unlike Flang's `TODO`. This means that both this and 
`OpenMPClauseEmitter::emitNYI` emit errors and then continue normally. I think 
the right thing to do is to make the latter return an `mlir::LogicalResult` and 
handle it properly when calling it:
```c++
if (failed(ce.emitNYI</*supported=*/...>(/*nyi=*/OpenMPClauseList<...>{}...)))
  return mlir::failure();
```
And here:
```suggestion
    return cgm.errorNYI(s.getBeginLoc(), "OpenMP Parallel with Cancel");
```

https://github.com/llvm/llvm-project/pull/207019
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to