[PATCH] D19096: ThinLTO/ModuleLinker: add a flag to not always pull-in linkonce when performing importing
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 20 12:04:07 PDT 2016
joker.eph added inline comments.
================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:424
@@ +423,3 @@
+ // Instruct the linker that the client will take care of linkonce resolution
+ unsigned Flags = Linker::Flags::DontForceLinkLinkonceODR;
+
----------------
joker.eph wrote:
> tejohnson wrote:
> > This should be passed down from the client, not hardwired here. E.g. this resolution is not yet done in gold. E.g. pass down to importFunctions() or to FunctionImporter constructor.
> Will update
I've been trying to add a flag to `ComputeCrossModuleImport` to force-import referenced discardable function, but it is very intrusive to handle.
I also tried to do it as a post-pass, but this does not work (it really can't).
Passing the flag to the FunctionImporter is wrong: this conflicts with the Import/Export list, so I don't want to go this route.
At this point, the easiest route is to force turn linkonce into weak unconditionally in clients.
http://reviews.llvm.org/D19096
More information about the llvm-commits
mailing list