[llvm-pdbdump] Rewrite dumper using visitor pattern.

This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2015-02-22 22:03:38 +00:00
parent e759e99a67
commit 395adf9f89
82 changed files with 1106 additions and 563 deletions

View File

@@ -53,7 +53,8 @@ public:
/// call dump() on the underlying RawSymbol, which allows us to discover
/// unknown properties, but individual implementations of PDBSymbol may
/// override the behavior to only dump known fields.
virtual void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level, PDB_DumpFlags Flags) const = 0;
virtual void dump(raw_ostream &OS, int Indent,
PDBSymDumper &Dumper) const = 0;
void defaultDump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const;
PDB_SymType getSymTag() const;
@@ -83,6 +84,8 @@ public:
const IPDBRawSymbol &getRawSymbol() const { return *RawSymbol; }
IPDBRawSymbol &getRawSymbol() { return *RawSymbol; }
const IPDBSession &getSession() const { return Session; }
protected:
std::unique_ptr<IPDBEnumSymbols> getChildStats(TagStats &Stats) const;