llvm/include/llvm-c
Peter Collingbourne a6367d9136 Teach LTOModule to emit linker flags for dllexported symbols, plus interface cleanup.
This change unifies how LTOModule and the backend obtain linker flags
for globals: via a new TargetLoweringObjectFile member function named
emitLinkerFlagsForGlobal. A new function LTOModule::getLinkerOpts() returns
the list of linker flags as a single concatenated string.

This change affects the C libLTO API: the function lto_module_get_*deplibs now
exposes an empty list, and lto_module_get_*linkeropts exposes a single element
which combines the contents of all observed flags. libLTO should never have
tried to parse the linker flags; it is the linker's job to do so. Because
linkers will need to be able to parse flags in regular object files, it
makes little sense for libLTO to have a redundant mechanism for doing so.

The new API is compatible with the old one. It is valid for a user to specify
multiple linker flags in a single pragma directive like this:

 #pragma comment(linker, "/defaultlib:foo /defaultlib:bar")

The previous implementation would not have exposed
either flag via lto_module_get_*deplibs (as the test in
TargetLoweringObjectFileCOFF::getDepLibFromLinkerOpt was case sensitive)
and would have exposed "/defaultlib:foo /defaultlib:bar" as a single flag via
lto_module_get_*linkeropts. This may have been a bug in the implementation,
but it does give us a chance to fix the interface.

Differential Revision: http://reviews.llvm.org/D10548

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 22:04:09 +00:00
..
Transforms [BDCE] Add a bit-tracking DCE pass 2015-02-17 01:36:59 +00:00
Analysis.h
BitReader.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
BitWriter.h Introduce LLVMWriteBitcodeToMemoryBuffer C API function. 2014-10-14 00:30:59 +00:00
Core.h Update LLVM bindings after r239940. Apparently these aren't included in 2015-06-18 11:51:16 +00:00
Disassembler.h Extend C disassembler API to allow specifying target features 2014-09-30 16:31:40 +00:00
ExecutionEngine.h [C API] Expose LLVMGetGlobalValueAddress and LLVMGetFunctionAddress. 2014-12-22 18:53:11 +00:00
Initialization.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
IRReader.h Fix known typos 2014-01-24 17:20:08 +00:00
Linker.h Restore LLVMLinkModules C API until it is properly deprecated. 2015-03-02 18:59:38 +00:00
LinkTimeOptimizer.h include/llvm-c: Whitespace. 2013-10-23 17:56:29 +00:00
lto.h Teach LTOModule to emit linker flags for dllexported symbols, plus interface cleanup. 2015-06-29 22:04:09 +00:00
module.modulemap [modules] The LLVM C API does not require C++! 2014-06-12 22:09:39 +00:00
Object.h Convert getFileOffset to getOffset and move it to its only user. 2014-04-21 13:45:32 +00:00
Support.h Add more wrappers for symbol APIs to the C API. 2015-06-09 15:57:30 +00:00
Target.h [llvm-c] Remove dead typedef 2013-11-11 14:47:01 +00:00
TargetMachine.h Add target analysis passes to the codegen pipeline for MCJIT. 2014-01-23 19:23:28 +00:00