[patch] Allow linkonce_odr aliases
Nick Lewycky
nlewycky at google.com
Sat Oct 5 14:47:54 PDT 2013
On 5 October 2013 04:58, Rafael EspĂndola <rafael.espindola at gmail.com>wrote:
> 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.
>
Thanks. Patch LGTM. I'd appreciate if you added documentation to the
section "alias" in the LangRef to document which linkage types are
permitted (I was surprised to see you didn't update it, but that's because
there's nothing there about it at all).
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131005/c88f9f50/attachment.html>
More information about the llvm-commits
mailing list