summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-07-28 19:11:09 +0000
committerZachary Turner <zturner@google.com>2016-07-28 19:11:09 +0000
commit199f48a5f0d5aee8737880a78d81216d60cf785d (patch)
treee801928d8148e3b77a22a69e8b8962e7bb9d7c19 /llvm/lib/DebugInfo/PDB/Raw
parent941a705b7bf155fc581632ec7d80f22a139bdac0 (diff)
downloadbcm5719-llvm-199f48a5f0d5aee8737880a78d81216d60cf785d.tar.gz
bcm5719-llvm-199f48a5f0d5aee8737880a78d81216d60cf785d.zip
Get rid of IMsfStreamData class.
This was a pure virtual base class whose purpose was to abstract away the notion of how you retrieve the layout of a discontiguous stream of blocks in an Msf file. This led to too many layers of abstraction making it difficult to figure out what was going on and extend things. Ultimately, a stream's layout is decided by its length and the array of block numbers that it lives on. So rather than have an abstract base class which can return this in any number of ways, it's more straightforward to simply store them as fields of a trivial struct, and also to give a more appropriate name. This patch does that. It renames IMsfStreamData to MsfStreamLayout, and deletes the 2 concrete implementations, DirectoryStreamData and IndexedStreamData. MsfStreamLayout is a trivial struct with the necessary data. llvm-svn: 277018
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp2
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp10
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp1
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp1
8 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
index 1bad0009c37..35f79c801ba 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
@@ -9,7 +9,6 @@
#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/StreamArray.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/Msf/StreamWriter.h"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
index 3d1bcdfd849..c55f51d7d4a 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
@@ -10,7 +10,6 @@
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/Msf/StreamWriter.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp
index 39e9dfaf3e2..65d59a5e894 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp
@@ -9,7 +9,6 @@
#include "llvm/DebugInfo/PDB/Raw/ModStream.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index f9ad8995db3..ea0a8c91304 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -10,8 +10,6 @@
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/ADT/ArrayRef.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"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
index 49bcb2f7dfe..5007a56f276 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
@@ -58,8 +58,7 @@ DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() {
return *Dbi;
}
-Expected<std::unique_ptr<PDBFile>>
-PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
+Expected<msf::Layout> PDBFileBuilder::finalizeMsfLayout() const {
if (Info) {
uint32_t Length = Info->calculateSerializedLength();
if (auto EC = Msf->setStreamSize(StreamPDB, Length))
@@ -71,7 +70,12 @@ PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
return std::move(EC);
}
- auto ExpectedLayout = Msf->build();
+ return Msf->build();
+}
+
+Expected<std::unique_ptr<PDBFile>>
+PDBFileBuilder::build(std::unique_ptr<msf::StreamInterface> PdbFileBuffer) {
+ auto ExpectedLayout = finalizeMsfLayout();
if (!ExpectedLayout)
return ExpectedLayout.takeError();
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
index 426efb8fd88..8f96e5e61f5 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
@@ -26,7 +26,6 @@
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/MappedBlockStream.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp
index f98b5d4688b..a604df3ae9a 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp
@@ -11,7 +11,6 @@
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/MappedBlockStream.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
index f642940bbc9..6756580547a 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
@@ -13,7 +13,6 @@
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
-#include "llvm/DebugInfo/Msf/IndexedStreamData.h"
#include "llvm/DebugInfo/Msf/MappedBlockStream.h"
#include "llvm/DebugInfo/Msf/StreamReader.h"
#include "llvm/DebugInfo/PDB/Raw/Hash.h"
OpenPOWER on IntegriCloud