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.