<div dir="ltr">Thanks Reid,<div><br></div><div>That explains. And the local variables turn out to be of type "std::string". Although it is not possible to ask the customer not to use std::string, at least I can explain it :-)  Adapting my analysis pass is another thing.</div><div><br></div><div>Thanks,</div><div>Welson</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 6, 2015 at 9:47 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If you have local variables with non-trivial destructors (say, std::unique_ptr or std::vector), then Clang will turn calls into invokes. The unwind edge of the invoke executes when an exception is thrown from the call, and the code along that edge destroys local objects in scope before resuming unwinding.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Oct 6, 2015 at 9:25 AM, Welson Sun via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi,</div><div><br></div><div>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.</div><div><br></div><div>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, <b>for each function call</b>, 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().</div><div><br></div><div>If I compile with -fno-exceptions, all function calls become normal "call", without any "unwind" attribute.</div><br clear="all"><div><br></div>Thanks<span><font color="#888888"><br><div><div dir="ltr">- Welson<br><div><div><div><br></div></div></div></div></div>
</font></span></div>
<br></div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">- Welson<br><div><div><div><br></div></div></div></div></div>
</div>