Remove unused function, fix warning (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Thu, 25 Mar 2021 18:36:33 +0000 (18:36 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 25 Mar 2021 18:37:57 +0000 (18:37 +0000)
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.

mlir/lib/IR/Block.cpp

index a24b639..d390d49 100644 (file)
@@ -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
 //===----------------------------------------------------------------------===//