[Mlir-commits] [mlir] fcdf142 - Remove unused function, fix warning (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Mar 25 11:38:09 PDT 2021


Author: Mehdi Amini
Date: 2021-03-25T18:37:57Z
New Revision: fcdf142ed59c4d0dcceab3d9a75d9a082b8e6b7a

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

LOG: Remove unused function, fix warning (NFC)

The `mayNotHaveTerminator` was initially on Block but moved to the
verifier before landing and wasn't removed from its original place
where it is unused.

Added: 
    

Modified: 
    mlir/lib/IR/Block.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/Block.cpp b/mlir/lib/IR/Block.cpp
index a24b639f7a45..d390d490b176 100644
--- a/mlir/lib/IR/Block.cpp
+++ b/mlir/lib/IR/Block.cpp
@@ -294,21 +294,6 @@ Block *Block::splitBlock(iterator splitBefore) {
   return newBB;
 }
 
-/// Returns true if this block may be valid without terminator. That is if:
-/// - it does not have a parent region.
-/// - Or the parent region have a single block and:
-///    - This region does not have a parent op.
-///    - Or the parent op is unregistered.
-///    - Or the parent op has the NoTerminator trait.
-static bool mayNotHaveTerminator(Block *block) {
-  if (!block->getParent())
-    return true;
-  if (!llvm::hasSingleElement(*block->getParent()))
-    return false;
-  Operation *op = block->getParentOp();
-  return !op || op->mightHaveTrait<OpTrait::NoTerminator>();
-}
-
 //===----------------------------------------------------------------------===//
 // Predecessors
 //===----------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list