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.