summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-03-21 18:02:34 +0000
committerReid Kleckner <rnk@google.com>2019-03-21 18:02:34 +0000
commitcda7ff9ddcefe0051d173e7c126c679063d29fbb (patch)
tree713386565511fb68be19bc7a746562e994b1ab5b /llvm/tools/llvm-pdbutil/DumpOutputStyle.h
parent0760758fed77077130fd7a386af2711f8e0f6ae3 (diff)
downloadbcm5719-llvm-cda7ff9ddcefe0051d173e7c126c679063d29fbb.tar.gz
bcm5719-llvm-cda7ff9ddcefe0051d173e7c126c679063d29fbb.zip
[llvm-pdbutil] Add -type-ref-stats to help find unused type info
Summary: This considers module symbol streams and the global symbol stream to be roots. Most types that this considers "unreferenced" are referenced by LF_UDT_MOD_SRC_LINE id records, which VC seems to always include. Essentially, they are types that the user can only find in the debugger if they call them by name, they cannot be found by traversing a symbol. In practice, around 80% of type information in a PDB is referenced by a symbol. That seems like a reasonable number. I don't really plan to do anything with this tool. It mostly just exists for informational purposes, and to confirm that we probably don't need to implement type reference tracking in LLD. We can continue to merge all types as we do today without wasting space. Reviewers: zturner, aganea Subscribers: mgorny, hiraditya, arphaman, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59620 llvm-svn: 356692
Diffstat (limited to 'llvm/tools/llvm-pdbutil/DumpOutputStyle.h')
-rw-r--r--llvm/tools/llvm-pdbutil/DumpOutputStyle.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
index c95490e95df..a55522389a7 100644
--- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
+++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h
@@ -34,6 +34,7 @@ class COFFObjectFile;
namespace pdb {
class GSIHashTable;
class InputFile;
+class TypeReferenceTracker;
struct StatCollection {
struct Stat {
@@ -62,6 +63,7 @@ class DumpOutputStyle : public OutputStyle {
public:
DumpOutputStyle(InputFile &File);
+ ~DumpOutputStyle() override;
Error dump() override;
@@ -89,6 +91,7 @@ private:
Error dumpNewFpo(PDBFile &File);
Error dumpTpiStream(uint32_t StreamIdx);
Error dumpTypesFromObjectFile();
+ Error dumpTypeRefStats();
Error dumpModules();
Error dumpModuleFiles();
Error dumpModuleSymsForPdb();
@@ -104,6 +107,7 @@ private:
void dumpSectionHeaders(StringRef Label, DbgHeaderType Type);
InputFile &File;
+ std::unique_ptr<TypeReferenceTracker> RefTracker;
LinePrinter P;
SmallVector<StreamInfo, 32> StreamPurposes;
};
OpenPOWER on IntegriCloud