2017-01-11 01:35:43 +01:00
|
|
|
//===- PrettyClassDefinitionDumper.h ----------------------------*- C++ -*-===//
|
2015-02-23 06:58:34 +01:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-02-23 06:58:34 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-01-11 01:35:43 +01:00
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSDEFINITIONDUMPER_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSDEFINITIONDUMPER_H
|
2015-02-23 06:58:34 +01:00
|
|
|
|
2017-04-10 21:33:29 +02:00
|
|
|
#include "llvm/ADT/BitVector.h"
|
|
|
|
|
2015-02-23 06:58:34 +01:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
|
2017-01-11 01:35:43 +01:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
|
2015-02-23 06:58:34 +01:00
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <memory>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
namespace llvm {
|
[llvm-pdbdump] More advanced class definition dumping.
Previously the dumping of class definitions was very primitive,
and it made it hard to do more than the most trivial of output
formats when dumping. As such, we would only dump one line for
each field, and then dump non-layout items like nested types
and enums.
With this patch, we do a complete analysis of the object
hierarchy including aggregate types, bases, virtual bases,
vftable analysis, etc. The only immediately visible effects
of this are that a) we can now dump a line for the vfptr where
before we would treat that as padding, and b) we now don't
treat virtual bases that come at the end of a class as padding
since we have a more detailed analysis of the class's storage
usage.
In subsequent patches, we should be able to use this analysis
to display a complete graphical view of a class's layout including
recursing arbitrarily deep into an object's base class / aggregate
member hierarchy.
llvm-svn: 300133
2017-04-13 01:18:21 +02:00
|
|
|
class BitVector;
|
|
|
|
|
2016-05-04 22:32:13 +02:00
|
|
|
namespace pdb {
|
2015-02-23 06:58:34 +01:00
|
|
|
|
2017-04-13 01:18:51 +02:00
|
|
|
class ClassLayout;
|
2015-02-27 10:15:59 +01:00
|
|
|
class LinePrinter;
|
|
|
|
|
2015-02-23 06:58:34 +01:00
|
|
|
class ClassDefinitionDumper : public PDBSymDumper {
|
|
|
|
public:
|
2015-02-27 10:15:59 +01:00
|
|
|
ClassDefinitionDumper(LinePrinter &P);
|
2015-02-23 06:58:34 +01:00
|
|
|
|
2017-04-13 23:11:00 +02:00
|
|
|
void start(const PDBSymbolTypeUDT &Class);
|
|
|
|
void start(const ClassLayout &Class);
|
2015-02-23 06:58:34 +01:00
|
|
|
|
|
|
|
private:
|
2017-04-13 01:18:51 +02:00
|
|
|
void prettyPrintClassIntro(const ClassLayout &Class);
|
|
|
|
void prettyPrintClassOutro(const ClassLayout &Class);
|
|
|
|
|
2015-02-27 10:15:59 +01:00
|
|
|
LinePrinter &Printer;
|
2017-04-24 19:47:52 +02:00
|
|
|
bool DumpedAnything = false;
|
2015-02-23 06:58:34 +01:00
|
|
|
};
|
|
|
|
}
|
2016-05-04 22:32:13 +02:00
|
|
|
}
|
2015-02-23 06:58:34 +01:00
|
|
|
#endif
|