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)
commit9abe1089c7863a02b86bc39e571522de98a97b0a
treee069fdaf555dd5bbc519499fc0e6b327bac39417
parent48eb19743455842a3cf3c8b945bc4d633e493da3
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>
llvm-svn: 254581
llvm/include/llvm/Bitcode/ReaderWriter.h
llvm/include/llvm/IR/FunctionInfo.h
llvm/include/llvm/Object/FunctionIndexObjectFile.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Linker/LinkModules.cpp
llvm/lib/Object/FunctionIndexObjectFile.cpp
llvm/tools/llvm-link/llvm-link.cpp