[cfe-dev] exit() emits exception handling?

Welson Sun via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 6 09:25:29 PDT 2015


Hi,

I am trying to understand some LLVM IR Clang generates. Since I cannot
publish the source code, I can only describe what I see and my guess.

This is the main() function of some code, which allocates some memory and
sequentially calls a list of functions. There are no explicit exception
handling code in the source code, however, *for each function call*, the
LLVM IR for the function call becomes "invoke ... unwind ...". I am
wondering what causes the generation of such code. One thing I noticed in
the source code is the exit() call in main().

If I compile with -fno-exceptions, all function calls become normal "call",
without any "unwind" attribute.


Thanks
- Welson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151006/dd3c410b/attachment.html>


More information about the cfe-dev mailing list