[LLVMdev] Branching to Entry block

Chris Lattner sabre at nondot.org
Thu Feb 17 11:27:44 PST 2005


On Thu, 17 Feb 2005, Misha Brukman wrote:
> On Thu, Feb 17, 2005 at 01:22:22PM -0600, Chris Lattner wrote:
>> // Approach number 2, the more explicit way:
>> BB->getParent()->getInstList().erase(BB);     // Remove from list & delete
>>
>> // Approach number 3, remove from the list, then delete it explicitly:
>> BB->getParent()->getInstList().remove(BB);    // Just remove from list
>> delete BB;                                    // Delete block
>
> Minor correction there: replace "getInstList()" with
> "getBasicBlockList()".  The former is only applicable to BasicBlocks,
> the latter to Functions.

oops, right, thanks Misha! :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list