[LLVMdev] CFG entry and exit blocks

Duncan Sands baldrick at free.fr
Thu Apr 1 01:51:45 PDT 2010


On 31/03/10 21:47, Reid Kleckner wrote:
> 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.

Other possibilities are functions which always throw an exception, and
functions which call "exit".

Ciao,

Duncan.



More information about the llvm-dev mailing list