Produce direct calls instead of alias to linkonce_odr functions

Reid Kleckner rnk at
Mon Nov 4 21:11:39 PST 2013

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

> > We already reject linkonce_odr declarations, so it should fail the
> > verifier. Any ideas on how to assert earlier?
> I decided to use a debugger to step over
> struct foo {
>   ~foo() {}
> };
> struct bar {
>   ~bar() {foo x;}
> };
> bar y;
> foo x;
> What happens is that at the end of GetOrCreateLLVMFunction we check if
> we have a decl defined in class and if so add it to
> DeferredDeclsToEmit. The net result is that we end up running
> replaceAllUsesWith twice when something in DeferredDeclsToEmit causes
> a new use of the destructor/constructor.
> Do you think this is OK? If not I can add a list of "DeclsToReplace"
> to Codegen and process that after EmitDeferred.

Ah, that makes sense.  Sounds fine, if a little bit silly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the cfe-commits mailing list