Chayan Sarkar
2010-Jul-18 18:06 UTC
[LLVMdev] How to traverse Dominator Tree in pre-order manner
Hi, Can anyone tell me how to traverse Dominator tree in pre-order manner? Regards, Chayan
John Criswell
2010-Jul-19 14:49 UTC
[LLVMdev] How to traverse Dominator Tree in pre-order manner
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 (and then use a method of the Node to get the BasicBlock held in that Node). However, I don't see such a method in the doxygen documentation for mainline LLVM. Does this method still exist? My own code (written for LLVM 2.6) traverses the dominator tree top-down as well, and I'll probably need to port this code to LLVM 2.7 and beyond. -- John T.> Regards, > Chayan > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Devang Patel
2010-Jul-19 22:01 UTC
[LLVMdev] How to traverse Dominator Tree in pre-order manner
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 NodeThere is a iterator that can be used to walk children.> (and then use a method of the Node to get the BasicBlock held > in that Node).This exists. getBlock(). - Devang