diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp')
| -rw-r--r-- | gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp index 25076e40fc9..c96553ff9b1 100644 --- a/gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp +++ b/gnu/llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp @@ -49,6 +49,10 @@ void DbiStreamBuilder::setSectionMap(ArrayRef<SecMapEntry> SecMap) { SectionMap = SecMap; } +void DbiStreamBuilder::setGlobalsStreamIndex(uint32_t Index) { + GlobalsStreamIndex = Index; +} + void DbiStreamBuilder::setSymbolRecordStreamIndex(uint32_t Index) { SymRecordStreamIndex = Index; } @@ -86,24 +90,9 @@ uint32_t DbiStreamBuilder::calculateSerializedLength() const { Expected<DbiModuleDescriptorBuilder &> DbiStreamBuilder::addModuleInfo(StringRef ModuleName) { uint32_t Index = ModiList.size(); - auto MIB = - llvm::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf); - auto M = MIB.get(); - auto Result = ModiMap.insert(std::make_pair(ModuleName, std::move(MIB))); - - if (!Result.second) - return make_error<RawError>(raw_error_code::duplicate_entry, - "The specified module already exists"); - ModiList.push_back(M); - return *M; -} - -Error DbiStreamBuilder::addModuleSourceFile(StringRef Module, StringRef File) { - auto ModIter = ModiMap.find(Module); - if (ModIter == ModiMap.end()) - return make_error<RawError>(raw_error_code::no_entry, - "The specified module was not found"); - return addModuleSourceFile(*ModIter->second, File); + ModiList.push_back( + llvm::make_unique<DbiModuleDescriptorBuilder>(ModuleName, Index, Msf)); + return *ModiList.back(); } Error DbiStreamBuilder::addModuleSourceFile(DbiModuleDescriptorBuilder &Module, @@ -270,7 +259,7 @@ Error DbiStreamBuilder::finalize() { H->SymRecordStreamIndex = SymRecordStreamIndex; H->PublicSymbolStreamIndex = PublicsStreamIndex; H->MFCTypeServerIndex = kInvalidStreamIndex; - H->GlobalSymbolStreamIndex = kInvalidStreamIndex; + H->GlobalSymbolStreamIndex = GlobalsStreamIndex; Header = H; return Error::success(); @@ -307,19 +296,6 @@ static uint16_t toSecMapFlags(uint32_t Flags) { return Ret; } -void DbiStreamBuilder::addSectionContrib(DbiModuleDescriptorBuilder *ModuleDbi, - const object::coff_section *SecHdr) { - SectionContrib SC; - memset(&SC, 0, sizeof(SC)); - SC.ISect = (uint16_t)~0U; // This represents nil. - SC.Off = SecHdr->PointerToRawData; - SC.Size = SecHdr->SizeOfRawData; - SC.Characteristics = SecHdr->Characteristics; - // Use the module index in the module dbi stream or nil (-1). - SC.Imod = ModuleDbi ? ModuleDbi->getModuleIndex() : (uint16_t)~0U; - SectionContribs.emplace_back(SC); -} - // A utility function to create a Section Map for a given list of COFF sections. // // A Section Map seem to be a copy of a COFF section list in other format. |
