[patch] Allow linkonce_odr aliases

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Oct 5 04:58:07 PDT 2013


On 5 October 2013 04:28, Nick Lewycky <nlewycky at google.com> wrote:
> On 4 October 2013 20:09, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
> wrote:
>>
>> I noticed that gcc produces alias when compiling
>>
>> void g();
>> template<typename T>
>> struct foobar {
>>   foobar() {
>>     g();
>>   }
>> };
>> foobar<void> x;
>>
>> To do the same in clang (patch to go in a sec) we have to allow
>> linkonce_odr aliases in llvm. The attached patch does that.
>
>
> Sorry -- I don't yet understand the motivation. What alias does it produce?
> My gcc 4.8.1 doesn't produce an alias on this code on x86-64 linux at -O0.

Strange. The alias I see is

.set _ZN6foobarIvEC1Ev,_ZN6foobarIvEC2Ev

I have attached the entire gcc output.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.s
Type: application/octet-stream
Size: 1656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131005/38523b51/attachment.obj>


More information about the llvm-commits mailing list