Add support to the linker to lazily link in functions. This change only links functio...
authorTanya Lattner <tonic@nondot.org>
Wed, 2 Nov 2011 00:24:56 +0000 (00:24 +0000)
committerTanya Lattner <tonic@nondot.org>
Wed, 2 Nov 2011 00:24:56 +0000 (00:24 +0000)
commit9af37a3de8c8688adae383471379f0216287ce28
tree13cabf70b63cff656aa78c1bd3117db79e3411d0
parent0d7b231c9b0acf2ea6bb99f75672751f64c6c6db
Add support to the linker to lazily link in functions. This change only links functions marked with specific linkage (internal, private, linker_private, linker_private_weak, linker_private_weak_def_auto, linkonce, linkonce_odr, and available_externally) if they have uses in the destination module. Instead of automatically linking, these functions are placed onto a worklist to be processed in the final stage of linking. We iterate over the list and if any functions on the list have uses in the destination module, we link them in and repeat the process until no changes in the state (uses) has changed. This means that any functions in the LazilyLink worklist that have a use in the destination module will be linked in and none that don't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143524 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/LinkModules.cpp