[llvm-dev] Weak symbol/alias semantics

Teresa Johnson via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 18 07:37:13 PST 2017


On Wed, Jan 18, 2017 at 7:34 AM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Teresa Johnson <tejohnson at google.com> writes:
> > Ok, thanks. But how does that property work the strongalias case from the
> > original email. E.g.:
> >
> > @f = weak global ...
> > @strongalias = alias @f
> >
> > What we had concluded was that it should be transformed into the
> following
> > when this copy of @f is non-prevailing:
> >
> > @f = external global
> > @f.llvm.1 = internal global ...   // Internalized copy of original @f
> > @strongalias = alias @fv.llvm.1
>
> I would use private instead of insternal, but yes, that is it.
>

Right, it should be private.


>
> > Maybe we are just using different terminology for the same thing, but in
> > this case it seems as though we have broken the link between the original
> > alias @f and aliasee @strongalias? Or is the point that we haven't broken
> > the link between the value in this module of @f (copied to @f.llvm.1) and
> > @strongalias?
>
> Correct. The two origial symbols would still point to the save thing. It
> is just that one of the symbols is not used and is dropped. This is the
> case that becames simpler if the IR is required to be written as
>
> @data = private global....
> @f = weak alias @data
> @strongalias = alias @data
>

Ok thanks,
Teresa


>
> Cheers,
> Rafael
>



-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170118/be978342/attachment.html>


More information about the llvm-dev mailing list