[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h

Owen Anderson resistor at mac.com
Sat Apr 21 00:05:03 PDT 2007



Changes in directory llvm/include/llvm/Analysis:

Dominators.h updated: 1.75 -> 1.76
---
Log message:

Fix some null checks to actually test the part that needs checking.


---
Diffs of the changes:  (+2 -3)

 Dominators.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.75 llvm/include/llvm/Analysis/Dominators.h:1.76
--- llvm/include/llvm/Analysis/Dominators.h:1.75	Fri Apr 20 00:44:16 2007
+++ llvm/include/llvm/Analysis/Dominators.h	Sat Apr 21 02:04:45 2007
@@ -323,16 +323,15 @@
   
   /// Return the immediate dominator of A.
   BasicBlock *getIDom(BasicBlock *A) const {
-    if (!A) return 0;
-    
     ETNode *NodeA = getNode(A);
+    if (!NodeA) return 0;
     const ETNode *idom = NodeA->getFather();
     return idom ? idom->getData<BasicBlock>() : 0;
   }
   
   void getChildren(BasicBlock *A, std::vector<BasicBlock*>& children) const {
-    if (!A) return;
     ETNode *NodeA = getNode(A);
+    if (!NodeA) return;
     const ETNode* son = NodeA->getSon();
     
     if (!son) return;






More information about the llvm-commits mailing list