Index: include/llvm/IR/DomTreeUpdater.h =================================================================== --- include/llvm/IR/DomTreeUpdater.h +++ include/llvm/IR/DomTreeUpdater.h @@ -46,8 +46,8 @@ ~DomTreeUpdater() { flush(); } - /// Returns the UpdateStrategy of the class instance. - UpdateStrategy getUpdateStrategy() const { return Strategy; }; + /// Returns true if the class instance works under the Lazy UpdateStrategy. + bool isUpdateLazy() const { return Strategy == UpdateStrategy::Lazy; }; /// Returns true if it holds a DominatorTree. bool hasDomTree() const { return DT != nullptr; } Index: unittests/IR/DomTreeUpdaterTest.cpp =================================================================== --- unittests/IR/DomTreeUpdaterTest.cpp +++ unittests/IR/DomTreeUpdaterTest.cpp @@ -58,7 +58,7 @@ ASSERT_TRUE(DTU.hasDomTree()); ASSERT_TRUE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Eager); + ASSERT_FALSE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); ASSERT_TRUE(DTU.getPostDomTree().verify()); ASSERT_FALSE(DTU.hasPendingUpdates()); @@ -166,7 +166,7 @@ DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Eager); ASSERT_TRUE(DTU.hasDomTree()); ASSERT_TRUE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Eager); + ASSERT_FALSE(DTU.isUpdateLazy()); ASSERT_TRUE(DT.verify()); ASSERT_TRUE(PDT.verify()); @@ -239,7 +239,7 @@ DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy); ASSERT_TRUE(DTU.hasDomTree()); ASSERT_FALSE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy); + ASSERT_TRUE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); Function::iterator FI = F->begin(); @@ -327,7 +327,7 @@ DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy); ASSERT_TRUE(DTU.hasDomTree()); ASSERT_FALSE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy); + ASSERT_TRUE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); Function::iterator FI = F->begin(); @@ -453,7 +453,7 @@ DomTreeUpdater DTU(&DT, &PDT, DomTreeUpdater::UpdateStrategy::Lazy); ASSERT_TRUE(DTU.hasDomTree()); ASSERT_TRUE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy); + ASSERT_TRUE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); ASSERT_TRUE(DTU.getPostDomTree().verify()); @@ -535,7 +535,7 @@ DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy); ASSERT_TRUE(DTU.hasDomTree()); ASSERT_TRUE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy); + ASSERT_TRUE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); ASSERT_TRUE(DTU.getPostDomTree().verify()); @@ -624,7 +624,7 @@ ASSERT_TRUE(DTU.hasDomTree()); ASSERT_TRUE(DTU.hasPostDomTree()); - ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy); + ASSERT_TRUE(DTU.isUpdateLazy()); ASSERT_TRUE(DTU.getDomTree().verify()); ASSERT_TRUE(DTU.getPostDomTree().verify()); ASSERT_FALSE(DTU.hasPendingUpdates());