[LLVMdev] disable insertion of unreachables
Kenneth Uildriks
kennethuil at gmail.com
Wed Sep 9 06:12:09 PDT 2009
On Wed, Sep 9, 2009 at 12:16 AM, Max
Stonebraker<max.stonebraker at gmail.com> wrote:
>> if so, the assembly language docs say that
>> program behavior is undefined if such a function
>> ever returns.
>
> Yes, that's true, but for some static analysis applications such as control
> dependence analysis for programs that have arbitrary interprocedural control
> flow, one needs these additional non-executable control flow edges from
> noreturn functions to their immediate CFG successor.
But a block containing a noreturn function shouldn't *have* a CFG successor.
>
> Is there any way to avoid having the unreachables inserted in the first
> place?
If you do that, you'll have to terminate the block with some other
instruction. Which, according to the language definition, is
guaranteed to never execute.
"noreturn" is not what you're looking for. It means something
completely different from what you have in mind.
More information about the llvm-dev
mailing list