This is a follow up of https://reviews.llvm.org/D75700
where support of GlobalDecl with Microsoft mangler
is incomplete.
Details
- Reviewers
rjmccall tra rnk - Commits
- rGb472bd855ed8: [NFC] Let Microsoft mangler accept GlobalDecl
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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: | |
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. |
clang/lib/AST/MicrosoftMangle.cpp | ||
---|---|---|
47 | It seems Microsoft C++ ABI does not have ctor variants (https://github.com/llvm/llvm-project/blob/b2a2c38349a18b89b04d342632d5ea02f86dfdd6/clang/lib/CodeGen/CGClass.cpp#L1298). Clang currently assumes Ctor_Complete in such situation (https://github.com/llvm/llvm-project/blob/b2a2c38349a18b89b04d342632d5ea02f86dfdd6/clang/lib/CodeGen/CodeGenModule.cpp#L1356). |
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