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

Chris Lattner clattner at apple.com
Fri Apr 20 14:10:33 PDT 2007


>    /// Return the immediate dominator of A.
> -  BasicBlock *getIDom(BasicBlock *A) {
> +  BasicBlock *getIDom(BasicBlock *A) const {
> +    if (!A) return 0;
> +
>      ETNode *NodeA = getNode(A);

A can't be null here, please check that NodeA isn't null instead  
(i.e. that A is reachable).

-Chris

>      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();
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list