llvm/lib
John Brawn f653fb8714 Add auto-exporting of symbols from tools so that plugins work on Windows
The problem with plugins on Windows is that when building a plugin DLL it needs
to explicitly link against something (an exe or DLL) if it uses symbols from
that thing, and that thing must explicitly export those symbols. Also there's a
limit of 65535 symbols that can be exported. This means that currently plugins
only work on Windows when using BUILD_SHARED_LIBS, and that doesn't work with
MSVC.

This patch adds an LLVM_EXPORT_SYMBOLS_FOR_PLUGINS option, which when enabled
automatically exports from all LLVM tools the symbols that a plugin could want
to use so that a plugin can link against a tool directly. Plugins can specify
what tool they link against by using PLUGIN_TOOL argument to llvm_add_library.
The option can also be enabled on Linux, though there all it should do is
restrict the set of symbols that are exported as by default all symbols are
exported.

This option is currently OFF by default, as while I've verified that it works
with MSVC, linux gcc, and cygwin gcc, I haven't tried mingw gcc and I have no
idea what will happen on OSX. Also unfortunately we can't turn on
LLVM_ENABLE_PLUGINS when the option is ON as bugpoint-passes needs to be
loaded by both bugpoint.exe and opt.exe which is incompatible with this
approach. Also currently clang plugins don't work with this approach, which
will be fixed in future patches.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 11:16:43 +00:00
..
Analysis MemorySSA: Revert r269678 and r268068; replace with special casing in MemorySSA. 2016-05-26 04:58:46 +00:00
AsmParser Objective-C Class Properties: Autoupgrade "Class Properties" module flag. 2016-05-25 23:14:48 +00:00
Bitcode Objective-C Class Properties: Autoupgrade "Class Properties" module flag. 2016-05-25 23:14:48 +00:00
CodeGen [codeview] Use comdats for debug info describing comdat functions 2016-05-25 23:16:12 +00:00
DebugInfo [codeview] Move StreamInterface and StreamReader to libcodeview. 2016-05-25 20:37:03 +00:00
ExecutionEngine [RuntimeDyld] Call the SymbolResolver::findSymbolInLogicalDylib method when 2016-05-25 16:23:59 +00:00
Fuzzer [libfuzzer] replacing unittest for truncate_units with functional test. 2016-05-25 21:00:17 +00:00
IR [ConstantFold] NFC cleanup after previous change. 2016-05-26 07:08:09 +00:00
IRReader Remove autoconf support 2016-01-26 21:29:08 +00:00
LibDriver LibDriver: Silently do nothing when provided no inputs. 2016-04-13 19:36:04 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker ValueMaterializer: rename materializeDeclFor() to materialize() 2016-05-25 21:03:21 +00:00
LTO [ThinLTO] Refactor ODR resolution and internalization (NFC) 2016-05-25 14:03:11 +00:00
MC PR11740: Disable assembly debug info when assembly already contains line directives 2016-05-26 00:22:26 +00:00
Object Add FIXMEs to all derived classes of std::error_category. 2016-05-24 20:13:46 +00:00
ObjectYAML [obj2yaml] [yaml2obj] MachO support for rebase opcodes 2016-05-25 17:09:07 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
Passes [PM] Port PartiallyInlineLibCalls to the new pass manager. 2016-05-25 23:38:53 +00:00
ProfileData Add FIXMEs to all derived classes of std::error_category. 2016-05-24 20:13:46 +00:00
Support [AArch64] Adding a TargetParser for AArch64 2016-05-25 12:02:33 +00:00
TableGen [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
Target [Sparc] Extend the assembler printing support for Sparc back-end. 2016-05-26 07:28:31 +00:00
Transforms Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
CMakeLists.txt Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
LLVMBuild.txt Add LLVMBuild for ObjectYAML. 2016-03-01 21:29:33 +00:00