summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/FunctionIndexObjectFile.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-12-03 02:37:23 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-12-03 02:37:23 +0000
commit9abe1089c7863a02b86bc39e571522de98a97b0a (patch)
treee069fdaf555dd5bbc519499fc0e6b327bac39417 /llvm/lib/Object/FunctionIndexObjectFile.cpp
parent48eb19743455842a3cf3c8b945bc4d633e493da3 (diff)
downloadbcm5719-llvm-9abe1089c7863a02b86bc39e571522de98a97b0a.tar.gz
bcm5719-llvm-9abe1089c7863a02b86bc39e571522de98a97b0a.zip
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
Diffstat (limited to 'llvm/lib/Object/FunctionIndexObjectFile.cpp')
-rw-r--r--llvm/lib/Object/FunctionIndexObjectFile.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Object/FunctionIndexObjectFile.cpp b/llvm/lib/Object/FunctionIndexObjectFile.cpp
index 717c56bc901..fe111de1a9c 100644
--- a/llvm/lib/Object/FunctionIndexObjectFile.cpp
+++ b/llvm/lib/Object/FunctionIndexObjectFile.cpp
@@ -86,7 +86,7 @@ bool FunctionIndexObjectFile::hasFunctionSummaryInMemBuffer(
ErrorOr<std::unique_ptr<FunctionIndexObjectFile>>
FunctionIndexObjectFile::create(MemoryBufferRef Object,
DiagnosticHandlerFunction DiagnosticHandler,
- const Module *ExportingModule, bool IsLazy) {
+ bool IsLazy) {
std::unique_ptr<FunctionInfoIndex> Index;
ErrorOr<MemoryBufferRef> BCOrErr = findBitcodeInMemBuffer(Object);
@@ -94,7 +94,7 @@ FunctionIndexObjectFile::create(MemoryBufferRef Object,
return BCOrErr.getError();
ErrorOr<std::unique_ptr<FunctionInfoIndex>> IOrErr = getFunctionInfoIndex(
- BCOrErr.get(), DiagnosticHandler, ExportingModule, IsLazy);
+ BCOrErr.get(), DiagnosticHandler, IsLazy);
if (std::error_code EC = IOrErr.getError())
return EC;
@@ -125,8 +125,7 @@ std::error_code FunctionIndexObjectFile::findFunctionSummaryInMemBuffer(
// index object if found, or nullptr if not.
ErrorOr<std::unique_ptr<FunctionInfoIndex>>
llvm::getFunctionIndexForFile(StringRef Path,
- DiagnosticHandlerFunction DiagnosticHandler,
- const Module *ExportingModule) {
+ DiagnosticHandlerFunction DiagnosticHandler) {
ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr =
MemoryBuffer::getFileOrSTDIN(Path);
std::error_code EC = FileOrErr.getError();
@@ -134,8 +133,7 @@ llvm::getFunctionIndexForFile(StringRef Path,
return EC;
MemoryBufferRef BufferRef = (FileOrErr.get())->getMemBufferRef();
ErrorOr<std::unique_ptr<object::FunctionIndexObjectFile>> ObjOrErr =
- object::FunctionIndexObjectFile::create(BufferRef, DiagnosticHandler,
- ExportingModule);
+ object::FunctionIndexObjectFile::create(BufferRef, DiagnosticHandler);
EC = ObjOrErr.getError();
if (EC)
return EC;
OpenPOWER on IntegriCloud