[Mlir-commits] [mlir] 4fa8677 - [DominanceInfo] Make the ctor take a defaulted value for the operand. NFC.

Chris Lattner llvmlistbot at llvm.org
Sun Jun 13 18:25:56 PDT 2021


Author: Chris Lattner
Date: 2021-06-13T18:25:47-07:00
New Revision: 4fa8677860436b7cf75c5d8bb80a0996c3a83327

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

LOG: [DominanceInfo] Make the ctor take a defaulted value for the operand. NFC.

This allows it to be default constructible, which makes sense given it
ignores the operand.

Added: 
    

Modified: 
    mlir/include/mlir/IR/Dominance.h
    mlir/lib/IR/Verifier.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/Dominance.h b/mlir/include/mlir/IR/Dominance.h
index 68513c27aa0e..dcf45130ad1e 100644
--- a/mlir/include/mlir/IR/Dominance.h
+++ b/mlir/include/mlir/IR/Dominance.h
@@ -35,7 +35,7 @@ class DominanceInfoBase {
   using DomTree = llvm::DominatorTreeBase<Block, IsPostDom>;
 
 public:
-  DominanceInfoBase(Operation *op) {}
+  DominanceInfoBase(Operation *op = nullptr) {}
   DominanceInfoBase(DominanceInfoBase &&) = default;
   DominanceInfoBase &operator=(DominanceInfoBase &&) = default;
   ~DominanceInfoBase();

diff  --git a/mlir/lib/IR/Verifier.cpp b/mlir/lib/IR/Verifier.cpp
index ec1ee8b2db24..30c64761da3a 100644
--- a/mlir/lib/IR/Verifier.cpp
+++ b/mlir/lib/IR/Verifier.cpp
@@ -83,7 +83,7 @@ LogicalResult OperationVerifier::verifyOpAndDominance(Operation &op) {
   // check for any nested regions. We do this as a second pass since malformed
   // CFG's can cause dominator analysis constructure to crash and we want the
   // verifier to be resilient to malformed code.
-  DominanceInfo theDomInfo(&op);
+  DominanceInfo theDomInfo;
   domInfo = &theDomInfo;
   if (failed(verifyDominanceOfContainedRegions(op)))
     return failure();


        


More information about the Mlir-commits mailing list