summaryrefslogtreecommitdiff
path: root/tools/lto/lto.exports
Commit message (Collapse)AuthorAge
* LTO API: add lto_module_create_from_memory_with_path.Manman Ren2014-02-10
| | | | | | | | | | | | | | This function adds an extra path argument to lto_module_create_from_memory. The path argument will be passed to makeBuffer to make sure the MemoryBuffer has a name and the created module has a module identifier. This is mainly for emitting warning messages from the linker. When we emit warning message on a module, we can use the module identifier. rdar://15985737 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201114 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding new LTO APIs to parse metadata nodes and extract linker options andYunzhong Gao2014-01-21
| | | | | | | | | | dependent libraries from a bitcode module. Differential Revision: http://llvm-reviews.chandlerc.com/D2343 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199759 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r199361: Now, the sanitizer got the changeQuentin Colombet2014-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199362 91177308-0d34-0410-b5e6-96231b3b80d8
* [LTO] Modify lto.exports to force the sanitizer to rebuilt LTO.exportsQuentin Colombet2014-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199361 91177308-0d34-0410-b5e6-96231b3b80d8
* [LTO] Add a hook to map LLVM diagnostics into the clients of LTO.Quentin Colombet2014-01-15
| | | | | | | | | | | | | | | | | | | | Add a hook in the C API of LTO so that clients of the code generator can set their own handler for the LLVM diagnostics. The handler is defined like this: typedef void (*lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt) - severity says how bad this is. - diag is a string that contains the diagnostic message. - ctxt is the registered context for this handler. This hook is more general than the lto_get_error_message, since this function keeps only the latest message and can only be queried when something went wrong (no warning for instance). <rdar://problem/15517596> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199338 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".Rafael Espindola2013-10-31
| | | | | | | | | | | | | | | | | | | | | | There are two ways one could implement hiding of linkonce_odr symbols in LTO: * LLVM tells the linker which symbols can be hidden if not used from native files. * The linker tells LLVM which symbols are not used from other object files, but will be put in the dso symbol table if present. GOLD's API is the second option. It was implemented almost 1:1 in llvm by passing the list down to internalize. LLVM already had partial support for the first option. It is also very similar to how ld64 handles hiding these symbols when *not* doing LTO. This patch then * removes the APIs for the DSO list. * marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr global values and other linkonce_odr whose address is not used. * makes the gold plugin responsible for handling the API mismatch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193800 91177308-0d34-0410-b5e6-96231b3b80d8
* Add lto_codegen_add_dso_symbol to the export list.Rafael Espindola2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191970 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 189297, the original commit message is following. Shuxin Yang2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---- Add new API lto_codegen_compile_parallel(). This API is proposed by Nick Kledzik. The semantic is: -------------------------------------------------------------------------- Generate code for merged module into an array of native object files. On success returns a pointer to an array of NativeObjectFile. The count parameter returns the number of elements in the array. Each element is a pointer/length for a generated mach-o/ELF buffer. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details). extern const struct NativeObjectFile* lto_codegen_compile_parallel(lto_code_gen_t cg, size_t *count); --------------------------------------------------------------------------- This API is currently only called on OSX platform. Linux or other Unixes using GNU gold are not supposed to call this function, because on these systems, object files are fed back to linker via disk file instead of memory buffer. In this commit, lto_codegen_compile_parallel() simply calls lto_codegen_compile() to return a single object file. In the near future, this function is the entry point for compilation with partition. Linker can blindly call this function even if partition is turned off; in this case, compiler will return only one object file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189386 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new API lto_codegen_compile_parallel().Shuxin Yang2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API is proposed by Nick Kledzik. The semantic is: -------------------------------------------------------------------------- Generate code for merged module into an array of native object files. On success returns a pointer to an array of NativeObjectFile. The count parameter returns the number of elements in the array. Each element is a pointer/length for a generated mach-o/ELF buffer. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details). extern const struct NativeObjectFile* lto_codegen_compile_parallel(lto_code_gen_t cg, size_t *count); --------------------------------------------------------------------------- This API is currently only called on OSX platform. Linux or other Unixes using GNU gold are not supposed to call this function, because on these systems, object files are fed back to linker via disk file instead of memory buffer. In this commit, lto_codegen_compile_parallel() simply calls lto_codegen_compile() to return a single object file. In the near future, this function is the entry point for compilation with partition. Linker can blindly call this function even if partition is turned off; in this case, compiler will return only one object file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189297 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r188188 and r188200.Shuxin Yang2013-08-12
| | | | | | | | | In order to appease people (in Apple) who accuse me for committing "huge change" (?) without proper review. Thank Eric for fixing a compile-warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188204 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc enhancements to LTO:Shuxin Yang2013-08-12
| | | | | | | | | | | | | | | | | | | | | | 1. Add some helper classes for partitions. They are designed in a way such that the top-level LTO driver will not see much difference with or without partitioning. 2. Introduce work-dir. Now all intermediate files generated during LTO phases will be saved under work-dir. User can specify the workdir via -lto-workdir=/path/to/dir. By default the work-dir will be erased before linker exit. To keep the workdir, do -lto-keep, or -lto-keep=1. TODO: Erase the workdir, if the linker exit prematurely. We are currently not able to remove directory on signal. The support routines simply ignore directory. 3. Add one new API lto_codegen_get_files_need_remove(). Linker and LTO plugin will communicate via this API about which files (including directories) need to removed before linker exit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188188 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r169656.Bill Wendling2012-12-10
| | | | | | | | | The linker will call `lto_codegen_add_must_preserve_symbol' on all globals that should be kept around. The linker will pretend that a dylib is being created. <rdar://problem/12528059> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169770 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the `lto_codegen_set_export_dynamic' function.Bill Wendling2012-12-08
| | | | | | | | | | | | | | | | | | | | | | This function sets the `_exportDynamic' ivar. When that's set, we export all symbols (e.g. we don't run the internalize pass). This is equivalent to the `--export-dynamic' linker flag in GNU land: --export-dynamic When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use this option, the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use dlopen to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. The Darwin linker will support this via the `-export_dynamic' flag. We should modify clang to support this via the `-rdynamic' flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169656 91177308-0d34-0410-b5e6-96231b3b80d8
* Add C API for specifying CPU to the disassembler.Jim Grosbach2012-12-07
| | | | | | | | | It was a nasty oversight that we didn't include this when we added this API in the first place. Blech. rdar://12839439 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169653 91177308-0d34-0410-b5e6-96231b3b80d8
* libLTO: Add a utility method to initialize the disassemblers.Benjamin Kramer2012-11-24
| | | | | | | | | | | | Necessary to give disassembler users (like darwin's otool) a possibility to dlopen libLTO and still initialize the required LLVM bits. This used to go through libMCDisassembler but that's a gross layering violation, the MC layer can't pull in functions from the targets. Adding a function to libLTO is a bit of a hack but not worse than exposing other disassembler bits from libLTO. Fixes PR14362. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168545 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for annotated disassembly output for X86 and arm.Kevin Enderby2012-10-22
| | | | | | | | | | | | Per the October 12, 2012 Proposal for annotated disassembly output sent out by Jim Grosbach this set of changes implements this for X86 and arm. The llvm-mc tool now has a -mdis option to produced the marked up disassembly and a couple of small example test cases have been added. rdar://11764962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166445 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove lto_codegen_set_whole_program_optimization. It is a work in progress,Rafael Espindola2012-04-16
| | | | | | | | | so we don't want it to show up in the stable 3.1 interface. While at it, add a comment about why LTOCodeGenerator manually creates the internalize pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154807 91177308-0d34-0410-b5e6-96231b3b80d8
* s/lto_codegen_whole_program_optimization/lto_codegen_set_whole_program_optim ↵Bill Wendling2012-04-09
| | | | | | ization/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154312 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hook to turn on the internalize pass through the LTO interface.Bill Wendling2012-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154306 91177308-0d34-0410-b5e6-96231b3b80d8
* Expoert c interface for disassembler.Devang Patel2011-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128440 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a lto_codegen_compile_to_file to avoid producing a file, reading it toRafael Espindola2011-03-22
| | | | | | memory and writing it back to disk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128108 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support in the LTO library for loading an object from the middleRafael Espindola2011-03-17
| | | | | | of an file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127781 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't open the file again in the gold plugin. To be able to do this, updateRafael Espindola2011-02-08
| | | | | | MemoryBuffer::getOpenFile to not close the file descriptor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
* lto_codegen_set_gcc_path was removed.Dan Gohman2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112069 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few missing entries in lto.exports.Dan Gohman2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112068 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to set the target triple and expose that with an option in theRafael Espindola2010-08-09
| | | | | | gold plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110604 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the EXPORTED_SYMBOL_FILE concept in the Makefiles to work withDan Gohman2010-04-15
| | | | | | | | | | | native linking export files, including running sed to prepend underscores on darwin, and make use of it in libLTO and libEnhancedDisassembly. Remove the leading underscores from library export files so that they work with the new EXPORTED_SYMBOL_FILE support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101399 91177308-0d34-0410-b5e6-96231b3b80d8
* <rdar://problem/6940611> libLTO.dylib needs to let linker specify path to ↵Nick Kledzik2009-06-04
| | | | | | | | | | | | assembler Add lto_codegen_set_assembler_path() API which allows the linker to specify the path to the assembler tool to run. When assembler is used (instead of compiler) different command line options are used. Add LTO_API_VERSION #define so clients (linkers) can conditionalize use of new APIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72823 91177308-0d34-0410-b5e6-96231b3b80d8
* add _lto_codegen_debug_options so that linker can use itNick Kledzik2008-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53213 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename new lto2 tool as lto.Devang Patel2008-06-30
lto2->lto git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52912 91177308-0d34-0410-b5e6-96231b3b80d8