<div dir="ltr">Ping.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 7:02 PM, 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">Hi rjmccall,<br>
<br>
Based on Peter Collingbourne's destructor patches.<br>
<br>
Prior to this change, clang was considering ?1 to be the complete<br>
destructor and the base destructor, which was wrong.  This lead to<br>
crashes in TUs with non-inline dtors where both complete and base dtors<br>
would be emitted and mangle to the same symbol.<br>
<br>
Furthermore, TUs with non-inline dtors don't emit a complete destructor.<br>
They are emitted as inline thunks in TUs that need them, and they always<br>
delegate to the base dtors of the derived class and its virtual bases.<br>
This change uses the DeferredDecls machinery to emit them.  There are<br>
comments in EmitDestructorBody() that suggest this won't work when the<br>
body of the dtor is a try block, but this is how cl.exe does things.<br>
<br>
Finally, for classes that don't use virtual inheritance, MSVC always<br>
calls the base destructor (?1) directly.  This is a useful code size<br>
optimization that avoids emitting lots of extra thunks or aliases.<br>
Implementing it also means our existing tests continue to pass, and is<br>
consistent with MSVC's output.<br>
<br>
We could probably do the same for Itanium without breaking anything.<br>
There is an existing -mconstructor-aliases that makes the complete dtor<br>
a linker alias, but it is off by default.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1066" target="_blank">http://llvm-reviews.chandlerc.com/D1066</a><br>
<br>
Files:<br>
  include/clang/Basic/TargetCXXABI.h<br>
  lib/AST/MicrosoftMangle.cpp<br>
  lib/CodeGen/CGCXX.cpp<br>
  lib/CodeGen/CGClass.cpp<br>
  lib/CodeGen/CGExprCXX.cpp<br>
  lib/CodeGen/CodeGenModule.cpp<br>
  lib/CodeGen/CodeGenModule.h<br>
  test/CodeGenCXX/microsoft-abi-structors.cpp<br>
</blockquote></div><br></div>