[PATCH] MS ABI: Implement copy-ctor closures, finish implementing throw

David Majnemer david.majnemer at gmail.com
Tue Mar 10 17:46:16 PDT 2015


On Tuesday, March 10, 2015, Reid Kleckner <rnk at google.com> wrote:

> ================
> Comment at: include/clang/Basic/ABI.h:28-29
> @@ -29,1 +27,4 @@
> +  Ctor_Comdat,         ///< The COMDAT used for ctors
> +  Ctor_CopyingClosure, ///< Copying closure variant of a ctor
> +  Ctor_DefaultClosure, ///< Default closure variant of a ctor
>  };
> ----------------
> I'm not super psyched about adding to this enum. What do you think about
> adding custom entry points to the MS C++ ABI that just tweak internal bools?


We should do the same with Ctor_Comdat.  That can be done in a follow up
change.


>
> ================
> Comment at: lib/AST/MicrosoftMangle.cpp:782-788
> @@ -781,9 +784,9 @@
> -        const auto *CD = cast<CXXConstructorDecl>(ND);
> -        if (CD->isDefaultConstructor()) {
> -          Out << "?_F";
> -        } else if (CD->isCopyConstructor()) {
> +      if (Structor == getStructor(ND)) {
> +        if (StructorType == Ctor_CopyingClosure) {
>            Out << "?_O";
> -        } else {
> -          llvm_unreachable("unexpected constructor closure!");
> +          return;
> +        }
> +        if (StructorType == Ctor_DefaultClosure) {
> +          Out << "?_F";
> +          return;
>          }
> -      } else {
> ----------------
> Oh dear, does isCopyConstructor() return false for the variadic test case?


It doesn't return true for templated constructors because they aren't copy
constructors.  However, they are used at the catch-site; clang terms these
as "copying constructors".


>
> http://reviews.llvm.org/D8225
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150310/9549f532/attachment.html>


More information about the cfe-commits mailing list