[PATCH] D19307: ModuleLinker: only import what is in the GlobalsToImport for ThinLTO, regarless if it is a function or not.
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 21:46:37 PDT 2016
joker.eph created this revision.
joker.eph added a reviewer: tejohnson.
joker.eph added a subscriber: llvm-commits.
Herald added a subscriber: joker.eph.
There is no change in the validation, I'm not sure if it is dead code?
http://reviews.llvm.org/D19307
Files:
lib/Linker/LinkModules.cpp
Index: lib/Linker/LinkModules.cpp
===================================================================
--- lib/Linker/LinkModules.cpp
+++ lib/Linker/LinkModules.cpp
@@ -272,25 +272,9 @@
bool DestIsDeclaration = Dest.isDeclarationForLinker();
if (isPerformingImport()) {
- if (isa<Function>(&Src)) {
- // For functions, LinkFromSrc iff this is a function requested
- // for importing. For variables, decide below normally.
- LinkFromSrc = GlobalsToImport->count(&Src);
- return false;
- }
-
- // Check if this is an alias with an already existing definition
- // in Dest, which must have come from a prior importing pass from
- // the same Src module. Unlike imported function and variable
- // definitions, which are imported as available_externally and are
- // not definitions for the linker, that is not a valid linkage for
- // imported aliases which must be definitions. Simply use the existing
- // Dest copy.
- if (isa<GlobalAlias>(&Src) && !DestIsDeclaration) {
- assert(isa<GlobalAlias>(&Dest));
- LinkFromSrc = false;
- return false;
- }
+ // LinkFromSrc iff this is a global requested for importing.
+ LinkFromSrc = GlobalsToImport->count(&Src);
+ return false;
}
if (SrcIsDeclaration) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19307.54317.patch
Type: text/x-patch
Size: 1291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160420/62c8715d/attachment.bin>
More information about the llvm-commits
mailing list