Produce direct calls instead of alias to linkonce_odr functions

Reid Kleckner rnk at
Mon Nov 4 14:37:53 PST 2013

How do you deal with the case where not all references to the aliased
entity have been generated yet?  For example:

Emit call to derived ctor
Emit derived ctor
RAUW derived ctor with base ctor
Emit call to derived ctor, create new declaration for it

I attempted this before, and this is the issue I hit.

On Mon, Nov 4, 2013 at 2:21 PM, Rafael EspĂ­ndola <rafael.espindola at
> wrote:

> On 4 November 2013 12:21, Richard Smith <richard at> wrote:
> > I'm a bit confused by this. We seem to stop emitting some weak_odr
> symbols
> > with this patch. Are those symbols not required by the ABI? (If not, why
> > were they weak_odr and not linkonce_odr?)
> They were weak_odr aliases to linkonce_odr symbols. They were there as
> a workaround for us not having comdat support directly in LLVM IR.
> Given how comdat work, every translation unit has to make the same
> decisions as to what gets put in a comdat. Since we implement weak
> symbols with comdats, the alias to them cannot be linkonce, otherwise
> one TU could have both symbols and another just one.
> So a way to look at this patch is that it avoid the need for that
> workaround by not emitting aliases in that case.
> Cheers,
> Rafael
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the cfe-commits mailing list