[llvm-dev] Detect exception throwing in basic blocks

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Wed May 16 10:45:23 PDT 2018


In LLVM IR, you would see an `invoke` instruction that calls the
appropriate C++ runtime function to set up a C++ exception. It would be
__cxa_throw or CxxThrowException on Windows.

Since only function calls can throw, this is not a property of the basic
block, but a property of individual call instructions.

On Wed, May 16, 2018 at 10:28 AM Dávid Bolvanský via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello,
>
> For code:
> try {
> throw 42;
> } catch(int e){}
>
> Are there any helpers in LLVM API to give me info that in "try block"
> there is a throw which will be executed? I am interested in info "yes, this
> block throws".
>
> Thank you
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180516/c34e740b/attachment.html>


More information about the llvm-dev mailing list