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

Chris Lattner clattner at apple.com
Thu Apr 19 22:27:16 PDT 2007


> +  /// Return the immediate dominator of A.
> +  BasicBlock *getIDom(BasicBlock *A) {
> +    ETNode *NodeA = getNode(A);
> +    const ETNode *idom = NodeA->getFather();
> +    return idom ? idom->getData<BasicBlock>() : 0;
> +  }

Random other question: Why does ETNode have a template accessor to  
get its data?  Is the Data pointer every anything other than a  
BasicBlock*?  If not, why not just type the pointer as BasicBlock*  
and rename getData() -> getBasicBlock() ?

-Chris



More information about the llvm-commits mailing list