[patch][pr22217] Use the most recent decl for mangling
david.majnemer at gmail.com
Wed Jan 21 10:01:25 PST 2015
I think clang's delayed codegen approach is a design flaw, I'd be happy to
see it gone.
On Wednesday, January 21, 2015, Rafael Espíndola <rafael.espindola at gmail.com>
> On 20 January 2015 at 12:42, David Majnemer <david.majnemer at gmail.com
> > I don't think this approach would handle things like:
> > int pr22217_foo;
> > int *b = &pr22217_foo;
> > extern int pr22217_foo __asm__("pr22217_bar");
> > With your patch, pr22217_foo gets emitted.
> > With gcc, pr22217_bar gets emitted.
> Gosh, this part is horrible. I can see two options:
> * Check in CodeGenModule::getMangledName than the name we get is the
> same as the cache and error if not. Very expensive. Just rejecting
> __asm__ after the name has been computed might have the same effect
> and be cheaper.
> * Delay all of codegen. Basically just return false from
> CodeGenModule::MayBeEmittedEagerly and try to avoid the order change
> in codegen. The more I think about it, the more this looks desirable.
> It should also fix pr16187 and allow us to finally cache visibility
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits