diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-01 21:53:50 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-01 21:53:50 +0000 |
commit | 5a2e5d324e9f2cab1ab909671a8b6ec68cc8e60f (patch) | |
tree | cf3e82644aa8730e077cbab0d410f637aeace11b /clang/lib/Serialization/ASTWriter.cpp | |
parent | 9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3 (diff) | |
download | bcm5719-llvm-5a2e5d324e9f2cab1ab909671a8b6ec68cc8e60f.tar.gz bcm5719-llvm-5a2e5d324e9f2cab1ab909671a8b6ec68cc8e60f.zip |
ThinLTO: special handling for LinkOnce functions
These function can be dropped by the compiler if they are no longer
referenced in the current module. However there is a change that
another module is still referencing them because of the import.
Multiple solutions can be used:
- Always import LinkOnce when a caller is imported. This ensure that
every module with a call to a LinkOnce has the definition and will
be able to emit it if it emits the call.
- Turn the LinkOnce into Weak, so that it is always emitted.
- Turn all LinkOnce into available_externally and come back after all
modules are codegen'ed to emit only one copy of the linkonce, when
there is still a reference to it.
This patch implement the second option, with am optimization that
only *one* module will turn the LinkOnce into Weak, while the others
will turn it into available_externally, so that there is exactly one
copy emitted for the whole compilation.
http://reviews.llvm.org/D18346
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265190
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
0 files changed, 0 insertions, 0 deletions