================
@@ -211,8 +211,26 @@ CIRGenFunction::emitOMPMasterDirective(const 
OMPMasterDirective &s) {
 }
 mlir::LogicalResult
 CIRGenFunction::emitOMPCriticalDirective(const OMPCriticalDirective &s) {
-  getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP 
OMPCriticalDirective");
-  return mlir::failure();
+  if (s.getDirectiveName().getName()) {
+    getCIRGenModule().errorNYI(s.getSourceRange(), "OpenMP named critical");
+    return mlir::failure();
+  }
+  assert(s.clauses().empty() && "Sema rejects hint without a name");
+
+  mlir::Location begin = getLoc(s.getBeginLoc());
+  auto criticalOp =
+      mlir::omp::CriticalOp::create(builder, begin, mlir::FlatSymbolRefAttr());
+
+  mlir::Block &block = criticalOp.getRegion().emplaceBlock();
----------------
aobolensk wrote:

Added CriticalOp builder

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

Reply via email to