Remove "ExportingModule" from ThinLTO Index (NFC)
authorMehdi Amini <mehdi.amini@apple.com>
Thu, 3 Dec 2015 02:37:23 +0000 (02:37 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Thu, 3 Dec 2015 02:37:23 +0000 (02:37 +0000)
commitd4c7e117aa0ff5868dee5ef18cfa5d3e56168361
tree2be932989050f9ac76f9b2f193957014dc5b1b1c
parentc0ebe8e8427c642b7bac0417fc5be3022f5b625d
Remove "ExportingModule" from ThinLTO Index (NFC)

There is no real reason the index has to have the concept of an
exporting Module. We should be able to have one single unique
instance of the Index, and it should be read-only after creation
for the whole ThinLTO processing.
The linker plugin should be able to process multiple modules (in
parallel or in sequence) with the same index.

The only reason the ExportingModule was present seems to be to
implement hasExportedFunctions() that is used by the Module linker
to decide what to do with the current Module.
For now I replaced it with a query to the map of Modules path to
see if this module was declared in the Index and consider that if
it is the case then it is probably exporting function.
On the long term the Linker interface needs to evolve and this
call should not be needed anymore.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254581 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/ReaderWriter.h
include/llvm/IR/FunctionInfo.h
include/llvm/Object/FunctionIndexObjectFile.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Linker/LinkModules.cpp
lib/Object/FunctionIndexObjectFile.cpp
tools/llvm-link/llvm-link.cpp