[LLVMdev] How to handle divide-by-zero exception?

Marc B. Reynolds marc.reynolds at orange.fr
Sun May 11 02:37:57 PDT 2008



> LLVM is completely "flat" - it has no local blocks at all.
> So a big part of exception handling is flattening this kind
> of code when outputting LLVM IR (which seems to be more or
> less what you are suggesting).  This is done by llvm-g++ for example.
> Try compiling some C++ code with try-catch-finally blocks with llvm-g++
with -S
> -emit-llvm -o - to see what I mean.  Inevitably flattening occurs before
LLVM
> even sees the code, since there is no direct way of representing nested
blocks in LLVM.

I was pretty much only thinking about hardware exceptions and traps which
can be
implictly triggered via a (normally) non-termintating instruction.

> Ciao,
> Duncan.





More information about the llvm-dev mailing list