[patch] First step to fix pr11866 during LTO

Rafael Espíndola rafael.espindola at gmail.com
Thu Oct 3 08:43:16 PDT 2013

> When a new API is added to llvm-c/lto.h, please bump LTO_API_VERSION
> so that the linker can configure itself to use the new function.


> But, is there a better name than “lto_codegen_add_symtab_symbol()”.  That
> name has no obvious meaning.  All symbols are symbol table symbols…
> I had to go back and re-read the email thread to figure out what it was
> supposed to do again.
> How about something like (existing plus new):
> /**
>  * Tells LTO optimization passes that this symbol must be preserved
>  * because it is referenced by native code or a command line option.
>  */
> void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol);
> /**
>  * Tells LTO optimization passes that a dynamic shared library is being
>  * built which exports all global symbols by default.  And that unless C++
>  * semantics allow the symbol to be completely optimized away, it should
>  * remain so it can be exported by the shared library.
>  */
> void lto_codegen_add_dso_symbol(lto_code_gen_t cg, const char *symbol);

I like it. I have propagated the s/symtab/dso/ name change and tweaked
some comments. A new patch is attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 17055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131003/dde60c8f/attachment.obj>

More information about the llvm-commits mailing list