[PATCH] D49056: [Dominators] Add isUpdateLazy() method to the DomTreeUpdater
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 11 21:13:10 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336886: [Dominators] Add isUpdateLazy() method to the DomTreeUpdater (authored by sima, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D49056?vs=155012&id=155113#toc
Repository:
rL LLVM
https://reviews.llvm.org/D49056
Files:
llvm/trunk/include/llvm/IR/DomTreeUpdater.h
llvm/trunk/unittests/IR/DomTreeUpdaterTest.cpp
Index: llvm/trunk/include/llvm/IR/DomTreeUpdater.h
===================================================================
--- llvm/trunk/include/llvm/IR/DomTreeUpdater.h
+++ llvm/trunk/include/llvm/IR/DomTreeUpdater.h
@@ -46,8 +46,11 @@
~DomTreeUpdater() { flush(); }
- /// Returns the UpdateStrategy of the class instance.
- UpdateStrategy getUpdateStrategy() const { return Strategy; };
+ /// Returns true if the current strategy is Lazy.
+ bool isLazy() const { return Strategy == UpdateStrategy::Lazy; };
+
+ /// Returns true if the current strategy is Eager.
+ bool isEager() const { return Strategy == UpdateStrategy::Eager; };
/// Returns true if it holds a DominatorTree.
bool hasDomTree() const { return DT != nullptr; }
Index: llvm/trunk/unittests/IR/DomTreeUpdaterTest.cpp
===================================================================
--- llvm/trunk/unittests/IR/DomTreeUpdaterTest.cpp
+++ llvm/trunk/unittests/IR/DomTreeUpdaterTest.cpp
@@ -58,7 +58,8 @@
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_TRUE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Eager);
+ ASSERT_TRUE(DTU.isEager());
+ ASSERT_FALSE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
ASSERT_TRUE(DTU.getPostDomTree().verify());
ASSERT_FALSE(DTU.hasPendingUpdates());
@@ -166,7 +167,8 @@
DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Eager);
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_TRUE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Eager);
+ ASSERT_TRUE(DTU.isEager());
+ ASSERT_FALSE(DTU.isLazy());
ASSERT_TRUE(DT.verify());
ASSERT_TRUE(PDT.verify());
@@ -239,7 +241,8 @@
DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_FALSE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy);
+ ASSERT_FALSE(DTU.isEager());
+ ASSERT_TRUE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
Function::iterator FI = F->begin();
@@ -327,7 +330,8 @@
DomTreeUpdater DTU(&DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_FALSE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy);
+ ASSERT_FALSE(DTU.isEager());
+ ASSERT_TRUE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
Function::iterator FI = F->begin();
@@ -453,7 +457,8 @@
DomTreeUpdater DTU(&DT, &PDT, DomTreeUpdater::UpdateStrategy::Lazy);
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_TRUE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy);
+ ASSERT_FALSE(DTU.isEager());
+ ASSERT_TRUE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
ASSERT_TRUE(DTU.getPostDomTree().verify());
@@ -535,7 +540,8 @@
DomTreeUpdater DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy);
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_TRUE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy);
+ ASSERT_FALSE(DTU.isEager());
+ ASSERT_TRUE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
ASSERT_TRUE(DTU.getPostDomTree().verify());
@@ -624,7 +630,8 @@
ASSERT_TRUE(DTU.hasDomTree());
ASSERT_TRUE(DTU.hasPostDomTree());
- ASSERT_EQ(DTU.getUpdateStrategy(), DomTreeUpdater::UpdateStrategy::Lazy);
+ ASSERT_FALSE(DTU.isEager());
+ ASSERT_TRUE(DTU.isLazy());
ASSERT_TRUE(DTU.getDomTree().verify());
ASSERT_TRUE(DTU.getPostDomTree().verify());
ASSERT_FALSE(DTU.hasPendingUpdates());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49056.155113.patch
Type: text/x-patch
Size: 3627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/976cfdd4/attachment.bin>
More information about the llvm-commits
mailing list