First patch looks good.

Any reason not to attempt to add more simplifications to the second patch?
We have duplicate code like this:

+  if (!CGM.getTarget().getCXXABI().hasConstructorVariants()) {

This is always true in Itanium and always false in Microsoft.

+    // If there are no constructor variants, always emit the complete
+    // destructor.
+    ctorType = StructorType::Complete;
+  } else if (!ctor->getParent()->getNumVBases() &&
+             (ctorType == StructorType::Complete ||
+              ctorType == StructorType::Base)) {
+    // The complete constructor is equivalent to the base constructor
+    // for classes with no virtual bases.  Try to emit it as an alias.
+    bool ProducedAlias = !CGM.TryEmitDefinitionAsAlias(
+        GlobalDecl(ctor, Ctor_Complete), GlobalDecl(ctor, Ctor_Base),
true);
+    if (ctorType == StructorType::Complete && ProducedAlias)
+      return;
+  }


On Thu, Sep 11, 2014 at 9:54 AM, Rafael Espíndola <
[email protected]> wrote:

> The first attached patch creates a emitCXXStructor function and makes
> the existing emitCXXConstructor and emitCXXDestructor static helpers.
>
> The next patch makes it be a method of CGCXXABI. For now with
> identical implementations in Itanium and Microsoft.
>
> The objective is that in subsequent patches we can
>
> * Simplify each implementation a bit.
> * Change the Itanium one to use comdats being sure the Microsoft one
>   is not changed.
>
> Cheers,
> Rafael
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to