> 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
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to