[LLVMdev] How to traverse Dominator Tree in pre-order manner

John Criswell criswell at uiuc.edu
Mon Jul 19 15:05:06 PDT 2010


Devang Patel wrote:
> On Mon, Jul 19, 2010 at 7:49 AM, John Criswell <criswell at uiuc.edu> wrote:
>   
>> Chayan Sarkar wrote:
>>     
>>> Hi,
>>>
>>> Can anyone tell me how to traverse Dominator tree in pre-order manner?
>>>
>>>       
>> In previous versions of LLVM, I believe you could get some sort of Node
>> object from DominatorTree and then use a method to get the children of
>> the Node
>>     
>
> There is a iterator that can be used to walk children.
>   

Okay.  I think I finally found it in doxygen:

http://llvm.org/doxygen/classllvm_1_1DomTreeNodeBase.html

>   
>> (and then use a method of the Node to get the BasicBlock held
>> in that Node).
>>     
>
> This exists. getBlock().
> -
> Devang
>   

Thanks, Devang.

-- John T.




More information about the llvm-dev mailing list