aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-10 22:43:25 +0000
committerZachary Turner <zturner@google.com>2015-02-10 22:43:25 +0000
commita5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9 (patch)
tree9012681968824b47f3c3f208cd91fa82cf48aa5d /llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
parentca19485f08fc41bb7de5be925c06735937b3ea50 (diff)
downloadllvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.zip
llvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.tar.gz
llvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.tar.bz2
Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbol.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbol.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
index bbc3952..d65a153 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
@@ -98,10 +98,17 @@ PDBSymbol::create(const IPDBSession &PDBSession,
}
}
-void PDBSymbol::dump(llvm::raw_ostream &OS) const { RawSymbol->dump(OS); }
+void PDBSymbol::defaultDump(raw_ostream &OS, int Indent,
+ PDB_DumpLevel Level) const {
+ RawSymbol->dump(OS, Indent, Level);
+}
PDB_SymType PDBSymbol::getSymTag() const { return RawSymbol->getSymTag(); }
+std::unique_ptr<IPDBEnumSymbols> PDBSymbol::findChildren(PDB_SymType Type) const {
+ return RawSymbol->findChildren(Type);
+}
+
std::unique_ptr<IPDBEnumSymbols>
PDBSymbol::findChildren(PDB_SymType Type, StringRef Name,
PDB_NameSearchFlags Flags) const {
@@ -118,3 +125,14 @@ std::unique_ptr<IPDBEnumSymbols>
PDBSymbol::findInlineFramesByRVA(uint32_t RVA) const {
return RawSymbol->findInlineFramesByRVA(RVA);
}
+
+std::unique_ptr<IPDBEnumSymbols>
+PDBSymbol::getChildStats(TagStats &Stats) const {
+ std::unique_ptr<IPDBEnumSymbols> Result(findChildren(PDB_SymType::None));
+ Stats.clear();
+ while (auto Child = Result->getNext()) {
+ ++Stats[Child->getSymTag()];
+ }
+ Result->reset();
+ return Result;
+}