Restore "Support for ThinLTO function importing and symbol linking."

This restores commit r251837, with the new library dependence added to
llvm-link/Makefile to address bot failures.

llvm-svn: 251866
This commit is contained in:
Teresa Johnson
2015-11-03 00:14:15 +00:00
parent 9c8905c7c8
commit c7ed52f2ba
14 changed files with 761 additions and 50 deletions

View File

@@ -5813,12 +5813,12 @@ llvm::getBitcodeTargetTriple(MemoryBufferRef Buffer, LLVMContext &Context,
ErrorOr<std::unique_ptr<FunctionInfoIndex>>
llvm::getFunctionInfoIndex(MemoryBufferRef Buffer, LLVMContext &Context,
DiagnosticHandlerFunction DiagnosticHandler,
bool IsLazy) {
const Module *ExportingModule, bool IsLazy) {
std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Buffer, false);
FunctionIndexBitcodeReader R(Buf.get(), Context, DiagnosticHandler, IsLazy);
std::unique_ptr<FunctionInfoIndex> Index =
llvm::make_unique<FunctionInfoIndex>();
llvm::make_unique<FunctionInfoIndex>(ExportingModule);
auto cleanupOnError = [&](std::error_code EC) {
R.releaseBuffer(); // Never take ownership on error.