[LLVMdev] "Refactoring" Basic Blocks into a new function

Chris Lattner sabre at nondot.org
Tue Apr 19 20:59:42 PDT 2005


On Tue, 19 Apr 2005, Evan Jones wrote:

> On Apr 19, 2005, at 21:39, Evan Jones wrote:
>> 1. To mark the section of code to be cut out, I'm using "magic" function 
>> calls (begin() and end()). In order to locate these calls, I am currently 
>> iterating over the basic blocks in a function using the iterator. Is it 
>> possible that I could get the blocks "out of order" with respect to the 
>> control flow?
>
> I just found the Interval class, and it looks like it could help me out here. 
> I want to locate the Interval that begins with the call to the "magic" 
> begin(), and ends with the call to the "magic" end(), if it exists. If there 
> is no such valid interval, then I want to detect that and return an error. 
> Can I make this happen by using the IntervalPartition pass? It looks like 
> LLVM has some functionality that I could use *some where.* I just can't quite 
> figure out how to make use of it.

An Interval (and an Interval partition) is a concept with a lot of 
compiler theory behind it.  If you google for control flow analysis and 
interval you should find info on it.  That said, I don't think it is what 
you're looking for...

-Chris

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




More information about the llvm-dev mailing list