[LLVMdev] CFG entry and exit blocks

Reid Kleckner rnk at mit.edu
Wed Mar 31 12:47:41 PDT 2010


On Wed, Mar 31, 2010 at 2:59 PM, Trevor Harmon <trevor.w.harmon at nasa.gov> wrote:
> I'm wondering what would cause a CFG not to have a return block. The
> comments in UnifyFunctionExitNodes.cpp say: "If there are no return
> stmts in the Function, a null pointer is returned." But this doesn't
> make sense; even an empty void function has a return block with a ret
> instruction inside it. Is there some other kind of source code pattern
> that would cause an absence of a return block?

Yes, an infinite loop.  The return block would be found unreachable and deleted.

Reid



More information about the llvm-dev mailing list