[clang] Adds an arbitrary pseudonym to clang"s windows mangler... (PR #97792)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 6 08:24:55 PDT 2024


memory-thrasher wrote:

> Godbolt for reference: https://godbolt.org/z/b9v8KhPET

Huh. Must be my vstools install on this windows laptop is out of date or broken in some other way. I could copy the scheme in that use case into my PR for at least a non-zero chance that it would match the msvc mangler in all other instances triggering that if. I must say that the thought of digging through the msvc binary to get a comprehensive handling does not feel me with excitement.

> likely with a new triple

I love the idea of another triple though. I would of course be using itanium if interfacing with system resources was not impossible. I'm thinking of two possible interpretations of a hybrid triple:
* msvc for all non-templates, itanium for all templates. Also causes any explicit extern template instances to be ignored to prevent the already remote possibility that a specialization or instance could be provided by a library (which would of course be mangled msvc-style).
* an `__attribute__ ` or other intrinsic to specify (in a header file) that an alternate mangler is to be used for the single connected symbol. As much as I hate the idea of compiler-specific code features, sometimes they are the right answer.

I prefer the former.

https://github.com/llvm/llvm-project/pull/97792


More information about the cfe-commits mailing list