Match cl.exe's mangling for decomposition declarations.
Decomposition declarations are considered to be anonymous structs, and use the same convention as for anonymous struct/union declarations.
Naming confirmed to match https://godbolt.org/z/K2osJa
Differential D67202
Implement Microsoft-compatible mangling for decomposition declarations. Authored by epastor on Sep 4 2019, 5:20 PM.
Details Match cl.exe's mangling for decomposition declarations. Decomposition declarations are considered to be anonymous structs, and use the same convention as for anonymous struct/union declarations. Naming confirmed to match https://godbolt.org/z/K2osJa
Diff Detail
Event TimelineComment Actions Does this pass ninja check-clang? If so, can you add a test for the new mangling, based on the manglings in the godbolt example? See clang/test/CodeGenCXX/mangle-ms-* for many examples; a new file mangle-ms-cxx20.cpp might be appropriate here. You can run bin/llvm-lit -vv clang/test/CodeGenCXX/foo.cpp to run a single lit test for iterating on the local test. Comment Actions ps: Thanks for the patch, this is great :) pps: Since this uses struct mangling, llvm-undname can already demangle these names, right? Comment Actions The change passes ninja check-clang - and I've added a test per your suggestions. Thanks! As for llvm-undname: it works reasonably well, but these are anonymous names. It successfully recognizes $S1, etc. as the "name", though! Comment Actions Thanks! Re llvm-undname: That seems to match behavior of MSVC's undname, so I'd say that's all good :) |