[patch][pr22217] Use the most recent decl for mangling
David Majnemer
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>
wrote:
> On 20 January 2015 at 12:42, David Majnemer <david.majnemer at gmail.com
> <javascript:;>> wrote:
> > 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
> computations.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150121/7fcd5931/attachment.html>
More information about the cfe-commits
mailing list