mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[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:
@@ -42,6 +42,7 @@
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
@@ -100,6 +101,12 @@ PDBSymbol::create(const IPDBSession &PDBSession,
|
||||
}
|
||||
}
|
||||
|
||||
#define TRY_DUMP_TYPE(Type) \
|
||||
if (const Type *DerivedThis = dyn_cast<Type>(this)) \
|
||||
Dumper.dump(OS, Indent, *DerivedThis);
|
||||
|
||||
#define ELSE_TRY_DUMP_TYPE(Type, Dumper) else TRY_DUMP_TYPE(Type, Dumper)
|
||||
|
||||
void PDBSymbol::defaultDump(raw_ostream &OS, int Indent,
|
||||
PDB_DumpLevel Level) const {
|
||||
RawSymbol->dump(OS, Indent, Level);
|
||||
|
Reference in New Issue
Block a user