summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbutil/LLVMOutputStyle.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-15 19:34:41 +0000
committerZachary Turner <zturner@google.com>2017-06-15 19:34:41 +0000
commitb560fdf3b84e18e3fb19d12cb2bd610dc2316118 (patch)
tree2101ce83d45cf3ffdc394dd3b3925ee12ea05dc7 /llvm/tools/llvm-pdbutil/LLVMOutputStyle.h
parent0f9c84cd936b6532495673613d9390efdc85cb3c (diff)
downloadbcm5719-llvm-b560fdf3b84e18e3fb19d12cb2bd610dc2316118.tar.gz
bcm5719-llvm-b560fdf3b84e18e3fb19d12cb2bd610dc2316118.zip
[llvm-pdbutil] rewrite the "raw" output style.
After some internal discussions, we agreed that the raw output style had outlived its usefulness. It was originally created before we had even thought of dumping to YAML, and it was intended to give us some insight into the internals of a PDB file. Now we have YAML mode which does almost exactly this but is more powerful in that it can round-trip back to a PDB, which the raw mode could not do. So the raw mode had become purely a maintenance burden. One option was to just delete it. However, its original goal was to be as readable as possible while staying close to the "metal" - i.e. presenting the output in a way that maps directly to the underlying file format. We don't actually need that last requirement anymore since it's covered by the yaml mode, so we could repurpose "raw" mode to actually just be as readable as possible. This patch implements about 80% of the functionality previously in raw mode, but in a completely different style that is more akin to what cvdump outputs. Records are very compressed, often times appearing on just one line. One nice thing about this is that it makes full record matching easier, because you can grep for indices, names, and leaf types on a single line often. See the tests for some examples of what the new output looks like. Note that this patch actually regresses the functionality of raw mode in a few areas, but only because the patch was already unreasonably large and going 100% would have been even worse. Specifically, this patch is missing: The ability to dump module debug subsections (checksums, lines, etc) The ability to dump section headers Aside from that everything is here. While goign through the tests fixing them all up, I found many duplicate tests. They've been deleted. In subsequent patches I will go through and re-add the missing functionality. Differential Revision: https://reviews.llvm.org/D34191 llvm-svn: 305495
Diffstat (limited to 'llvm/tools/llvm-pdbutil/LLVMOutputStyle.h')
-rw-r--r--llvm/tools/llvm-pdbutil/LLVMOutputStyle.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/llvm/tools/llvm-pdbutil/LLVMOutputStyle.h b/llvm/tools/llvm-pdbutil/LLVMOutputStyle.h
deleted file mode 100644
index 184dc4e1f44..00000000000
--- a/llvm/tools/llvm-pdbutil/LLVMOutputStyle.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===- LLVMOutputStyle.h -------------------------------------- *- C++ --*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMOUTPUTSTYLE_H
-#define LLVM_TOOLS_LLVMPDBDUMP_LLVMOUTPUTSTYLE_H
-
-#include "OutputStyle.h"
-
-#include "llvm/ADT/Optional.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/DebugInfo/CodeView/TypeDatabase.h"
-#include "llvm/Support/ScopedPrinter.h"
-
-#include <string>
-
-namespace llvm {
-class BitVector;
-
-namespace codeview {
-class LazyRandomTypeCollection;
-}
-
-namespace pdb {
-class LLVMOutputStyle : public OutputStyle {
-public:
- LLVMOutputStyle(PDBFile &File);
-
- Error dump() override;
-
-private:
- Expected<codeview::LazyRandomTypeCollection &>
- initializeTypeDatabase(uint32_t SN);
-
- Error dumpFileHeaders();
- Error dumpStreamSummary();
- Error dumpFreePageMap();
- Error dumpBlockRanges();
- Error dumpGlobalsStream();
- Error dumpStreamBytes();
- Error dumpStreamBlocks();
- Error dumpStringTable();
- Error dumpInfoStream();
- Error dumpTpiStream(uint32_t StreamIdx);
- Error dumpDbiStream();
- Error dumpSectionContribs();
- Error dumpSectionMap();
- Error dumpPublicsStream();
- Error dumpSectionHeaders();
- Error dumpFpoStream();
-
- void dumpBitVector(StringRef Name, const BitVector &V);
-
- void flush();
-
- PDBFile &File;
- ScopedPrinter P;
- std::unique_ptr<codeview::LazyRandomTypeCollection> TpiTypes;
- std::unique_ptr<codeview::LazyRandomTypeCollection> IpiTypes;
- SmallVector<std::string, 32> StreamPurposes;
-};
-}
-}
-
-#endif
OpenPOWER on IntegriCloud