>>> + /// getIDomBlock - return basic block BB's immediate domiantor >>> basic block. >>> + /// >>> + BasicBlock *getIDomBlock(BasicBlock *BB) { >>> + DomTreeNode *N = getNode(BB); >>> + assert (N && "Missing dominator tree node"); >>> + DomTreeNode *I = N->getIDom(); >>> + assert (N && "Missing immediate dominator"); >>> + return I->getBlock(); >>> + } >> >> This will assert and die if called on the entry node, because it has >> no idom. Would it make sense to have this function return null in >> this case? If so, please document it as returning null in that >> case. > > Current clients do not expect null here.
I assume that current clients never call this on an entry block. If they did it would assert :). I'm just saying that would be the behavior I would expect if calling this from a new client. -Chris _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits