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

Owen Anderson resistor at mac.com
Thu Apr 19 22:44:33 PDT 2007



Changes in directory llvm/include/llvm/Analysis:

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

Add null checks and const-ify these accessors.


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

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


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






More information about the llvm-commits mailing list