diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-20 05:44:16 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-20 05:44:16 +0000 |
commit | 7a5136d8c5788ffbde83979dc27ec79c64dd5bd2 (patch) | |
tree | a441e5ebc26ed89c065295189cc8e8f009f43e37 /llvm | |
parent | aac115a8e506d38c88b200bb6a891f634dbe9606 (diff) | |
download | bcm5719-llvm-7a5136d8c5788ffbde83979dc27ec79c64dd5bd2.tar.gz bcm5719-llvm-7a5136d8c5788ffbde83979dc27ec79c64dd5bd2.zip |
Add null checks and const-ify these accessors.
llvm-svn: 36270
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Analysis/Dominators.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h index 778b4eab759..1d7e2f351c7 100644 --- a/llvm/include/llvm/Analysis/Dominators.h +++ b/llvm/include/llvm/Analysis/Dominators.h @@ -322,13 +322,16 @@ public: } /// 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(); |