[LLVMdev] a basic question about BB
Vikram S. Adve
vadve at cs.uiuc.edu
Thu Nov 14 05:17:01 PST 2002
The choice of which you do should be based on whether you really need a
unified exit node.
It will be faster to traverse all the BBs and examine each terminator
instr. Than to insert the unified exit node.
> -----Original Message-----
> From: llvmdev-admin at cs.uiuc.edu
> [mailto:llvmdev-admin at cs.uiuc.edu] On Behalf Of Anand Shukla
> Sent: Thursday, November 14, 2002 12:06 AM
> To: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] a basic question about BB
> > > I want to know, given a function, How do I know which block is
> > > entry block, which blocks are exit blocks? Is there any efficient
> > > way to dicectly get that information?
> > Given a function you can always use
> Function::getEntryBlock() to get
> > the entry block. You need to scan the function to get the
> > nodes.
> You could also use UnifyExitNode (a pass in analysis) to
> unify the exits, and then use getExit() to get the exit node.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev