diff options
Diffstat (limited to 'source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp')
-rw-r--r-- | source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp b/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp index 67ea05767fde..1838204e4ca6 100644 --- a/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp +++ b/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp @@ -1,9 +1,8 @@ //===-- CompileUnitIndex.cpp ------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -125,11 +124,20 @@ CompilandIndexItem &CompileUnitIndex::GetOrCreateCompiland(uint16_t modi) { uint16_t stream = descriptor.getModuleStreamIndex(); std::unique_ptr<llvm::msf::MappedBlockStream> stream_data = m_index.pdb().createIndexedStream(stream); + + + std::unique_ptr<CompilandIndexItem>& cci = result.first->second; + + if (!stream_data) { + llvm::pdb::ModuleDebugStreamRef debug_stream(descriptor, nullptr); + cci = llvm::make_unique<CompilandIndexItem>(PdbCompilandId{ modi }, debug_stream, std::move(descriptor)); + return *cci; + } + llvm::pdb::ModuleDebugStreamRef debug_stream(descriptor, std::move(stream_data)); - cantFail(debug_stream.reload()); - std::unique_ptr<CompilandIndexItem> &cci = result.first->second; + cantFail(debug_stream.reload()); cci = llvm::make_unique<CompilandIndexItem>( PdbCompilandId{modi}, std::move(debug_stream), std::move(descriptor)); |