summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-08-21 14:53:25 +0000
committerZachary Turner <zturner@google.com>2017-08-21 14:53:25 +0000
commitd1de2f4f5e965d70053b0c0d20d99ad4a105f428 (patch)
treeee90fa721e95e1dfc93217e26d8eeaec8ab1f0a0 /llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
parent48c67c99651d431ec03edc2bdf11abdd24089d2c (diff)
downloadbcm5719-llvm-d1de2f4f5e965d70053b0c0d20d99ad4a105f428.tar.gz
bcm5719-llvm-d1de2f4f5e965d70053b0c0d20d99ad4a105f428.zip
[llvm-pdbutil] Add support for dumping detailed module stats.
This adds support for dumping a summary of module symbols and CodeView debug chunks. This option prints a table for each module of all of the symbols that occurred in the module and the number of times it occurred and total byte size. Then at the end it prints the totals for the entire file. Additionally, this patch adds the -jmc (just my code) option, which suppresses modules which are from external libraries or linker imports, so that you can focus only on the object files and libraries that originate from your own source code. llvm-svn: 311338
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
index de460d03e6b..414de7be91f 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
@@ -85,6 +85,11 @@ uint32_t PDBFile::getNumStreams() const {
return ContainerLayout.StreamSizes.size();
}
+uint32_t PDBFile::getMaxStreamSize() const {
+ return *std::max_element(ContainerLayout.StreamSizes.begin(),
+ ContainerLayout.StreamSizes.end());
+}
+
uint32_t PDBFile::getStreamByteSize(uint32_t StreamIndex) const {
return ContainerLayout.StreamSizes[StreamIndex];
}
@@ -229,6 +234,13 @@ ArrayRef<support::ulittle32_t> PDBFile::getDirectoryBlockArray() const {
return ContainerLayout.DirectoryBlocks;
}
+std::unique_ptr<MappedBlockStream> PDBFile::createIndexedStream(uint16_t SN) {
+ if (SN == kInvalidStreamIndex)
+ return nullptr;
+ return MappedBlockStream::createIndexedStream(ContainerLayout, *Buffer, SN,
+ Allocator);
+}
+
MSFStreamLayout PDBFile::getStreamLayout(uint32_t StreamIdx) const {
MSFStreamLayout Result;
auto Blocks = getStreamBlockList(StreamIdx);
OpenPOWER on IntegriCloud