<div dir="ltr">First patch looks good.<div><br></div><div>Any reason not to attempt to add more simplifications to the second patch? We have duplicate code like this:</div><div><br></div><div><div>+ if (!CGM.getTarget().getCXXABI().hasConstructorVariants()) {</div><div><br></div><div>This is always true in Itanium and always false in Microsoft.</div><div><br></div><div>+ // If there are no constructor variants, always emit the complete</div><div>+ // destructor.</div><div>+ ctorType = StructorType::Complete;</div><div>+ } else if (!ctor->getParent()->getNumVBases() &&</div><div>+ (ctorType == StructorType::Complete ||</div><div>+ ctorType == StructorType::Base)) {</div><div>+ // The complete constructor is equivalent to the base constructor</div><div>+ // for classes with no virtual bases. Try to emit it as an alias.</div><div>+ bool ProducedAlias = !CGM.TryEmitDefinitionAsAlias(</div><div>+ GlobalDecl(ctor, Ctor_Complete), GlobalDecl(ctor, Ctor_Base), true);</div><div>+ if (ctorType == StructorType::Complete && ProducedAlias)</div><div>+ return;</div><div>+ }</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 9:54 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The first attached patch creates a emitCXXStructor function and makes<br>
the existing emitCXXConstructor and emitCXXDestructor static helpers.<br>
<br>
The next patch makes it be a method of CGCXXABI. For now with<br>
identical implementations in Itanium and Microsoft.<br>
<br>
The objective is that in subsequent patches we can<br>
<br>
* Simplify each implementation a bit.<br>
* Change the Itanium one to use comdats being sure the Microsoft one<br>
is not changed.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>