[IR] Avoid the need to prefix MS C++ symbols with '\01'
Now the Windows mangling modes ('w' and 'x') do not do any mangling for
symbols starting with '?'. This means that clang can stop adding the
hideous '\01' leading escape. This means LLVM debug logs are less likely
to contain ASCII escape characters and it will be easier to copy and
paste MS symbol names from IR.
Finally.
For non-Windows platforms, names starting with '?' still get IR
mangling, so once clang stops escaping MS C++ names, we will get extra
'_' prefixing on MachO. That's fine, since it is currently impossible to
construct a triple that uses the MS C++ ABI in clang and emits macho
object files.
Differential Revision: https://reviews.llvm.org/D7775
llvm-svn: 327734
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 9d8242f..5bbbf32 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1940,17 +1940,22 @@
``a:<abi>:<pref>``
This specifies the alignment for an object of aggregate type.
``m:<mangling>``
- If present, specifies that llvm names are mangled in the output. The
+ If present, specifies that llvm names are mangled in the output. Symbols
+ prefixed with the mangling escape character ``\01`` are passed through
+ directly to the assembler without the escape character. The mangling style
options are
* ``e``: ELF mangling: Private symbols get a ``.L`` prefix.
* ``m``: Mips mangling: Private symbols get a ``$`` prefix.
* ``o``: Mach-O mangling: Private symbols get ``L`` prefix. Other
symbols get a ``_`` prefix.
- * ``w``: Windows COFF prefix: Similar to Mach-O, but stdcall and fastcall
- functions also get a suffix based on the frame size.
- * ``x``: Windows x86 COFF prefix: Similar to Windows COFF, but use a ``_``
- prefix for ``__cdecl`` functions.
+ * ``x``: Windows x86 COFF mangling: Private symbols get the usual prefix.
+ Regular C symbols get a ``_`` prefix. Functions with ``__stdcall``,
+ ``__fastcall``, and ``__vectorcall`` have custom mangling that appends
+ ``@N`` where N is the number of bytes used to pass parameters. C++ symbols
+ starting with ``?`` are not mangled in any way.
+ * ``w``: Windows COFF mangling: Similar to ``x``, except that normal C
+ symbols do not receive a ``_`` prefix.
``n<size1>:<size2>:<size3>...``
This specifies a set of native integer widths for the target CPU in
bits. For example, it might contain ``n32`` for 32-bit PowerPC,