diff options
author | Zachary Turner <zturner@google.com> | 2016-07-22 19:56:05 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-07-22 19:56:05 +0000 |
commit | bac69d33d013a86277cf2acb9809819e1623c732 (patch) | |
tree | 407e63a631bcc61579f375eb47394b145a48b46e /llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp | |
parent | b8f95b5c6e77a36b5d5736cd167d244d64e53b87 (diff) | |
download | llvm-bac69d33d013a86277cf2acb9809819e1623c732.zip llvm-bac69d33d013a86277cf2acb9809819e1623c732.tar.gz llvm-bac69d33d013a86277cf2acb9809819e1623c732.tar.bz2 |
[msf] Create LLVMDebugInfoMsf
This provides a better layering of responsibilities among different
aspects of PDB writing code. Some of the MSF related code was
contained in CodeView, and some was in PDB prior to this. Further,
we were often saying PDB when we meant MSF, and the two are
actually independent of each other since in theory you can have
other types of data besides PDB data in an MSF. So, this patch
separates the MSF specific code into its own library, with no
dependencies on anything else, and DebugInfoCodeView and
DebugInfoPDB take dependencies on DebugInfoMsf.
llvm-svn: 276458
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp index 9501675..b44a474 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp @@ -10,13 +10,13 @@ #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/CodeView/StreamArray.h" -#include "llvm/DebugInfo/CodeView/StreamInterface.h" -#include "llvm/DebugInfo/CodeView/StreamReader.h" -#include "llvm/DebugInfo/CodeView/StreamWriter.h" +#include "llvm/DebugInfo/Msf/DirectoryStreamData.h" +#include "llvm/DebugInfo/Msf/IndexedStreamData.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" -#include "llvm/DebugInfo/PDB/Raw/DirectoryStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/IndexedStreamData.h" #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" #include "llvm/DebugInfo/PDB/Raw/NameHashTable.h" #include "llvm/DebugInfo/PDB/Raw/PublicsStream.h" @@ -29,6 +29,7 @@ using namespace llvm; using namespace llvm::codeview; +using namespace llvm::msf; using namespace llvm::pdb; namespace { @@ -130,7 +131,8 @@ Error PDBFile::parseStreamData() { // is exactly what we are attempting to parse. By specifying a custom // subclass of IPDBStreamData which only accesses the fields that have already // been parsed, we can avoid this and reuse MappedBlockStream. - auto DS = MappedBlockStream::createDirectoryStream(*this); + auto DS = MappedBlockStream::createDirectoryStream( + SB->NumDirectoryBytes, getDirectoryBlockArray(), *this); if (!DS) return DS.takeError(); StreamReader Reader(**DS); @@ -315,7 +317,8 @@ Error PDBFile::commit() { if (auto EC = Writer.writeArray(DirectoryBlocks)) return EC; - auto DS = MappedBlockStream::createDirectoryStream(*this); + auto DS = MappedBlockStream::createDirectoryStream( + SB->NumDirectoryBytes, getDirectoryBlockArray(), *this); if (!DS) return DS.takeError(); auto DirStream = std::move(*DS); |