[PATCH] D28524: Finish decoupling TypeDatabase from TypeDumper
Zachary Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 11:51:05 PST 2017
zturner created this revision.
zturner added reviewers: amccarth, inglorion, rnk.
zturner added a subscriber: llvm-commits.
Herald added a subscriber: mgorny.
This is a followup to https://reviews.llvm.org/D28486, which finishes the decoupling of the type database from the dumper.
Previously the type dumper itself was passed around to a lot of different places and manipulated in ways that were more appropriate on the type database. For example, the entire `TypeDumper` was passed into the symbol dumper, when all the symbol dumper wanted to do was lookup the name of a `TypeIndex` so it could print it. That's what the `TypeDatabase` is for -- mapping type indices to names.
Another example is how if the user runs `llvm-pdbdump` with the option to dump symbols but not types, we still have to visit all types so that we can print minimal information about the type of a symbol, but just without dumping full symbol records. The way we did this before is by hacking it up so that we run everything through the type dumper with a null printer, so that the output goes to /dev/null. But really, we don't need to dump anything, all we want to do is build the type database. Since `TypeDatabaseVisitor` now exists independently of `TypeDumper`, we can do this. We just build a custom visitor callback pipeline that includes a database visitor but not a dumper.
All the hackery around printers etc goes away. After this patch, we could probably even delete the entire `CVTypeDumper` class since really all it is at this point is a thin wrapper that hides the details of how to build a useful visitation pipeline. It's not a priority though, so `CVTypeDumper` remains for now.
After this patch we will be able to easily plug in a different style of type dumper by only implementing the proper visitation methods to dump one-line output and then sticking it on the pipeline.
https://reviews.llvm.org/D28524
Files:
lld/COFF/PDB.cpp
llvm/include/llvm/DebugInfo/CodeView/CVTypeDumper.h
llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/DebugInfo/CodeView/CMakeLists.txt
llvm/lib/DebugInfo/CodeView/CVTypeDumper.cpp
llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp
llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
llvm/tools/llvm-pdbdump/LLVMOutputStyle.h
llvm/tools/llvm-readobj/COFFDumper.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28524.83838.patch
Type: text/x-patch
Size: 68271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/61f897aa/attachment.bin>
More information about the llvm-commits
mailing list