summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp')
-rw-r--r--lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp40
1 files changed, 8 insertions, 32 deletions
diff --git a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp b/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
index 25076e40fc98..c96553ff9b16 100644
--- a/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
+++ b/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.