[cfe-dev] Strange character around function declared with "asm"

Chris Lattner clattner at apple.com
Thu Dec 2 23:10:36 PST 2010


On Dec 2, 2010, at 11:07 PM, Eric Christopher wrote:

> 
> On Dec 2, 2010, at 11:06 PM, Chris Lattner wrote:
> 
>>>>>>> Apparently clang is mangling it this way on purpose as far as I can
>>>>>>> tell... I'm not really sure why though.
>>>>>> 
>>>>>> The gnu "asm renaming" extension says that USER_LABEL_PREFIX is not prefixed onto the symbol name.  The \1 prefix on the LLVM name tells the backend (through the 'Mangler' class) not to add it.
>>>>> 
>>>>> Interesting. llvm-gcc bug then?
>>>> 
>>>> What's the bug?
>>> 
>>> There's no \01 prefix in the llvm-gcc version of the module.
>> 
>> On linux or darwin?  IIRC, on linux there is no USER_LABEL_PREFIX so it doesn't matter if there is a \1 or not.
> 
> darwin.
> 
> Just checked out of curiosity :)

Ah, I didn't notice that the name was "llvm.foo".  It is entirely possible that llvm-gcc has a special hack for symbols that start with "llvm.", but I don't see it with a quick look.  This is dangerous though, because the intrinsics change over time, and not getting the right argument types would cause the middle-end to blow up.

-Chris



More information about the cfe-dev mailing list