[cfe-dev] Question about UnreachableInst and exit() system call

Prakash Prabhu prakash.prabhu at gmail.com
Thu May 13 23:48:08 PDT 2010


Hi,

I have a question about how clang handles exit() calls.  It seems that two
instructions (when -emit-llvm is used) are generated : CallInst followed by
UnreachableInst.  While this makes perfect sense from
semantics/optimization/correctness perspective, I am curious to know whether
it is possible to treat exit() like any other library call (ie, generate a
BranchInst  instead of UnreachableInst)  via a compile time switch/option ?
Any pointers to the relevant code (for handling exit()) within clang will
also be very helpful.

I am asking because some of the analysis I am writing in the backend would
be easier if I did not have to deal with exit() as a special case (mainly to
do with structured control flow).

thanks,
Prakash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100514/43ef685a/attachment.html>


More information about the cfe-dev mailing list