summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-22 22:03:38 +0000
committerZachary Turner <zturner@google.com>2015-02-22 22:03:38 +0000
commit9a818ad193d19ef2f560e6da4b0fcf6748979fdb (patch)
treedc22e1c7f49c2326e9ec39be74c601925dc9b133 /llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
parent87f4c90a5c0b38d497e975e8e2c54bbd6f4050a5 (diff)
downloadbcm5719-llvm-9a818ad193d19ef2f560e6da4b0fcf6748979fdb.tar.gz
bcm5719-llvm-9a818ad193d19ef2f560e6da4b0fcf6748979fdb.zip
[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. llvm-svn: 230184
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbol.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbol.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
index 9ab8b936a5d..f24e318a941 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
@@ -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);
OpenPOWER on IntegriCloud