If a function is renamed with __asm__, the name provided is the
exact symbol name, without any extra implicit symbol prefixes.
If the target does use symbol prefixes, the IR level symbol gets
an \01 prefix to indicate that it's a literal symbol name to be
taken as is.
When a builtin function is specialized by providing an inline
version of it, that inline function is named <funcname>.inline.
When the base function has been renamed due to __asm__, the inline
function ends up named <asmname>.inline. Up to this point,
things did work as expected before.
However, for targets with symbol prefixes, one codepath that produced
the combined name <asmname>.inline used the mangled asmname with
\01 prefix, while others didn't. This patch fixes this.
This fixes the combination of asm renamed builtin function, with
inline override of the function, on any target with symbol
prefixes (such as i386 windows and any Darwin target).
Alternatively, instead of reimplementing this piece of logic
here, should it try to call MangleContext::mangleName somehow?
I think you can call CGM.getMangledName, but I might be wrong. It's worth doing if straightforward.