Seems like I'm out of luck - the @<n> suffix is added
(AddFastCallStdCallSuffix) in the GlobalValue
Magnler::getNameWithPrefix overload, without paying respect to whether
the name originally had a '\1' prefix or not.
My problem is not related to correctly implementing the MS
stdcall/fastcall ABI itself, but rather a (sufficiently) similar one.
Thus, I need to specifically disable mangling in a case where it would
normally be needed.
For the quick-and-dirty patch I'm currently using locally, see below.
The patch looks incorrect. The code just needs to handle \1 properly
and clang extended to add explicit \1 to the names which does not
require mangling.
I do not think that moving whole mangling to clang is a good idea,
because then everyone who uses LLVM to call WinApi functions will need
to mangle by hands.
The patch looks incorrect. The code just needs to handle \1 properly
and clang extended to add explicit \1 to the names which does not
require mangling.
I think clang already adds \01 to __stdcall names, so only the LLVM
change is remaining.
I do not think that moving whole mangling to clang is a good idea,
because then everyone who uses LLVM to call WinApi functions will need
to mangle by hands.
Looks good to me, except for
; CHECK: MyFunc@0:
should be probably
; CHECK: {{^_MyFunc@0:}}
and
+; CHECK: alreadyMangled:
should be
+; CHECK: {{^alreadyMangled:}}