1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/lib/LTO
Teresa Johnson 525ee88977 [ThinLTO] Import local variables from the same module as caller
Summary:
We can sometimes end up with multiple copies of a local variable that
have the same GUID in the index. This happens when there are local
variables with the same name that are in different source files having the
same name/path at compile time (but compiled into different bitcode objects).

In this case make sure we import the copy in the caller's module.
This enables importing both of the variables having the same GUID
(but which will have different promoted names since the module paths,
and therefore the module hashes, will be distinct).

Importing the wrong copy is particularly problematic for read only
variables, since we must import them as a local copy whenever
referenced. Otherwise we get undefs at link time.

Note that the llvm-lto.cpp and ThinLTOCodeGenerator changes are needed
for testing the distributed index case via clang, which will be sent as
a separate clang-side patch shortly. We were previously not doing the
dead code/read only computation before computing imports when testing
distributed index generation (like it was for testing importing and
other ThinLTO mechanisms alone).

Reviewers: evgeny777

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, dang, llvm-commits

Differential Revision: https://reviews.llvm.org/D55047

llvm-svn: 347886
2018-11-29 17:02:42 +00:00
..
Caching.cpp
CMakeLists.txt
LLVMBuild.txt
LTO.cpp [ThinLTO] Consolidate cache key computation between new/old LTO APIs 2018-11-26 20:40:37 +00:00
LTOBackend.cpp [LTO] Drop non-prevailing definitions only if linkage is not local or appending 2018-11-08 20:10:07 +00:00
LTOCodeGenerator.cpp [PassTiming] cleaning up legacy PassTimingInfo interface. NFCI. 2018-09-26 13:01:43 +00:00
LTOModule.cpp [Support] Make error banner optional in logAllUnhandledErrors 2018-11-11 01:46:03 +00:00
ThinLTOCodeGenerator.cpp [ThinLTO] Import local variables from the same module as caller 2018-11-29 17:02:42 +00:00
UpdateCompilerUsed.cpp [LTO] Account for overriding lib calls via the alias attribute 2018-10-10 22:54:31 +00:00