[PATCH] Prevent user-supplied libc implementations from premature removal in LTO

Rafael Espíndola rafael.espindola at gmail.com
Mon Nov 4 15:49:32 PST 2013


On 4 November 2013 15:34, Duncan Exon Smith <dexonsmith at apple.com> wrote:
> On Nov 4, 2013, at 3:03 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>
>> There is no need to check -globalopt in this patch too. Just check
>> that  llvm.compiler.used is created with the value you expect.
>
> Okay, makes sense.
>
>> libLTO already knows about adding symbols used by inline asm to
>> llvm.compiler.used. Maybe this code would be better there?
>
> In particular, by modifying LTOCodeGenerator::applyRestriction?  That sounds nice and clean, except that I’m not sure how to get access to TargetLibraryInfo there.  Or is there a better way than TLI?

I think you can just do "new TargetLibraryInfo(TargetTriple);" like opt does.

Cheers,
Rafael




More information about the llvm-commits mailing list