[Mlir-commits] [mlir] 302158d - Apply clang-tidy fixes for llvm-else-after-return in OpenMPDialect.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Wed May 18 09:16:45 PDT 2022


Author: Mehdi Amini
Date: 2022-05-18T16:15:46Z
New Revision: 302158df6a694c051b46d28ff589c6fad8d81f5c

URL: https://github.com/llvm/llvm-project/commit/302158df6a694c051b46d28ff589c6fad8d81f5c
DIFF: https://github.com/llvm/llvm-project/commit/302158df6a694c051b46d28ff589c6fad8d81f5c.diff

LOG: Apply clang-tidy fixes for llvm-else-after-return in OpenMPDialect.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index 565744ccc2de..3c86243fa3a8 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -978,15 +978,15 @@ LogicalResult CancelOp::verify() {
     if (!isa<WsLoopOp>(parentOp)) {
       return emitOpError() << "cancel loop must appear "
                            << "inside a worksharing-loop region";
-    } else {
-      if (cast<WsLoopOp>(parentOp).nowaitAttr()) {
-        return emitError() << "A worksharing construct that is canceled "
-                           << "must not have a nowait clause";
-      } else if (cast<WsLoopOp>(parentOp).ordered_valAttr()) {
-        return emitError() << "A worksharing construct that is canceled "
-                           << "must not have an ordered clause";
-      }
     }
+    if (cast<WsLoopOp>(parentOp).nowaitAttr()) {
+      return emitError() << "A worksharing construct that is canceled "
+                         << "must not have a nowait clause";
+    } else if (cast<WsLoopOp>(parentOp).ordered_valAttr()) {
+      return emitError() << "A worksharing construct that is canceled "
+                         << "must not have an ordered clause";
+    }
+
   } else if (cct == ClauseCancellationConstructType::Sections) {
     if (!(isa<SectionsOp>(parentOp) || isa<SectionOp>(parentOp))) {
       return emitOpError() << "cancel sections must appear "
@@ -1023,8 +1023,9 @@ LogicalResult CancellationPointOp::verify() {
       !isa<WsLoopOp>(parentOp)) {
     return emitOpError() << "cancellation point loop must appear "
                          << "inside a worksharing-loop region";
-  } else if ((cct == ClauseCancellationConstructType::Sections) &&
-             !(isa<SectionsOp>(parentOp) || isa<SectionOp>(parentOp))) {
+  }
+  if ((cct == ClauseCancellationConstructType::Sections) &&
+      !(isa<SectionsOp>(parentOp) || isa<SectionOp>(parentOp))) {
     return emitOpError() << "cancellation point sections must appear "
                          << "inside a sections region";
   }


        


More information about the Mlir-commits mailing list