[PATCH] D31372: Support Microsoft mangling of swift calling convention methods

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 22 18:48:46 PDT 2017


rjmccall added a comment.
This revision now requires changes to proceed.

You can't just change the top-level mangling of the symbol because this is used as part of the function type mangling, and those can appear at more-or-less arbitrary positions.

I cannot possibly imagine Microsoft actually officially adding mangling support for every extension we support in Clang.  The closest you can reasonably expect is that they will add an official "vendor-extended" mangling.  Until then, picking an arbitrary string and acknowledging that it is not stable and will not correctly demangle is a reasonable thing to do.

The llvm_unreachable in this function is not an appropriate use of llvm_unreachable, by the way, unless there's something in the frontend that actually prevents creating such things on MS targets.  The uses of unreachable in ItaniumMangle are (according to our beliefs, anyway) *actually* impossible to reach, like an Objective-C selector being mangled as part of an unresolved-name.  A more acceptable approach when the mangling does not implement a case is to do something like what ItaniumMangle does on unsupported expression nodes: emit a (bad) diagnostic and continue.


https://reviews.llvm.org/D31372





More information about the cfe-commits mailing list