[LLVMdev] [PATCH] BasicBlock::getFirstNonPHI

Chris Lattner sabre at nondot.org
Sun Jun 4 12:27:13 PDT 2006


On Sun, 4 Jun 2006, Nick Lewycky wrote:
>> 2. There is no need to check for running off the end of the basic block,
>> you are guaranteed that a block has a terminator, which is not a PHI.
>
> Assuming it's a valid BasicBlock. Which, if I understand correctly,
> isn't always true in mid-transformation. Perhaps you should turn it into
> an assert instead, to minimize surprises?

It should already assert when it attempts to dereference the end iterator.

> I can't check if this actually happens with llvm.org seemingly down, but
> I do recall a situation like that. Maybe it was the BB list within a
> function?

As you say, this can only happen mid-transformation...

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list