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

llvm-svn: 36298
This commit is contained in:
Owen Anderson 2007-04-21 07:04:45 +00:00
parent 6121802090
commit 94e1d9aa39
1 changed files with 2 additions and 3 deletions

View File

@ -323,16 +323,15 @@ public:
/// 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;