[flang-commits] [flang] [OpenMP][Flang] Add "IsolatedFromAbove" trait to omp.target (PR #67164)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon Oct 30 04:49:18 PDT 2023


================
@@ -826,6 +890,12 @@ static LogicalResult verifyMapClause(Operation *op, OperandRange mapOperands) {
     if (auto MapInfoOp =
             mlir::dyn_cast<mlir::omp::MapInfoOp>(mapOp.getDefiningOp())) {
 
+      if (MapInfoOp.getVal() && MapInfoOp.getVarPtr())
+        emitError(op->getLoc(), "only one of val or var_ptr must be used");
+
+      if (!MapInfoOp.getVal() && !MapInfoOp.getVarPtr())
+        emitError(op->getLoc(), "missing val or var_ptr");
+
----------------
kiranchandramohan wrote:

Please add a test for this in `mlir/test/Dialect/OpenMP/invalid.mlir`.

https://github.com/llvm/llvm-project/pull/67164


More information about the flang-commits mailing list