Produce direct calls instead of alias to linkonce_odr functions

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Nov 4 18:06:45 PST 2013


> 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.

Cheers,
Rafael



More information about the cfe-commits mailing list