This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Let Microsoft mangler accept GlobalDecl
ClosedPublic

Authored by yaxunl on Nov 9 2021, 8:22 AM.

Details

Summary

This is a follow up of https://reviews.llvm.org/D75700
where support of GlobalDecl with Microsoft mangler
is incomplete.

Diff Detail

Event Timeline

yaxunl requested review of this revision.Nov 9 2021, 8:22 AM
yaxunl created this revision.
tra added a reviewer: rnk.Nov 9 2021, 10:48 AM
tra added a subscriber: rnk.

+ @rnk as it's a windows-specific change.

LGTM in general.

rnk added inline comments.Nov 9 2021, 12:39 PM
clang/lib/AST/MicrosoftMangle.cpp
47

I would prefer if you passed Ctor_Base and Dtor_Base here. I believe MSVC models the variants as separate compiler-generated functions. I believe the user code is always emitted into the "base" variant. That's consistent with what the user can observe in __FUNCDNAME__, see here:
https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/Expr.cpp#L635

345

I would like to remove these constructor overloads, but I don't feel like I can ask you to do it.

1250

So, nested calls to mangle seem like they mostly come up when you have entities inside function scopes. I think when we have things inside structors, we want to mangle using the base ctor/dtor variant.

yaxunl marked 2 inline comments as done.Nov 22 2021, 6:23 AM
yaxunl added inline comments.
rnk accepted this revision.Nov 22 2021, 8:03 AM

lgtm

clang/lib/AST/MicrosoftMangle.cpp
47

Hah, you're right, I forgot.

This revision is now accepted and ready to land.Nov 22 2021, 8:03 AM
This revision was landed with ongoing or failed builds.Nov 23 2021, 8:14 AM
This revision was automatically updated to reflect the committed changes.
yaxunl marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2021, 8:14 AM