#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
+#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include <utility>
std::unique_ptr<ArgEnumeratorType> ArgEnumerator)
: Session(PDBSession), Enumerator(std::move(ArgEnumerator)) {}
- uint32_t getChildCount() const { return Enumerator->getChildCount(); }
+ uint32_t getChildCount() const override {
+ return Enumerator->getChildCount();
+ }
- std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const {
+ std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override {
auto FunctionArgSymbol = Enumerator->getChildAtIndex(Index);
if (!FunctionArgSymbol)
return nullptr;
return Session.getSymbolById(FunctionArgSymbol->getTypeId());
}
- std::unique_ptr<PDBSymbol> getNext() {
+ std::unique_ptr<PDBSymbol> getNext() override {
auto FunctionArgSymbol = Enumerator->getNext();
if (!FunctionArgSymbol)
return nullptr;
return Session.getSymbolById(FunctionArgSymbol->getTypeId());
}
- void reset() { Enumerator->reset(); }
+ void reset() override { Enumerator->reset(); }
- MyType *clone() const {
+ MyType *clone() const override {
std::unique_ptr<ArgEnumeratorType> Clone(Enumerator->clone());
return new FunctionArgEnumerator(Session, std::move(Clone));
}
return Session.getSymbolById(ClassId);
}
-void PDBSymbolTypeFunctionSig::dumpArgList(raw_ostream &OS) const {
- OS << "(";
- if (auto ChildEnum = getArguments()) {
- uint32_t Index = 0;
- while (auto Arg = ChildEnum->getNext()) {
- Arg->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- if (++Index < ChildEnum->getChildCount())
- OS << ", ";
- }
- }
- OS << ")";
- if (isConstType())
- OS << " const";
- if (isVolatileType())
- OS << " volatile";
-}
-
-void PDBSymbolTypeFunctionSig::dump(raw_ostream &OS, int Indent,
- PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
- OS << stream_indent(Indent);
-
- if (auto ReturnType = getReturnType()) {
- ReturnType->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << " ";
- }
-
- OS << getCallingConvention() << " ";
- if (auto ClassParent = getClassParent()) {
- OS << "(";
- ClassParent->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
- OS << "::*)";
- }
-
- dumpArgList(OS);
+void PDBSymbolTypeFunctionSig::dump(PDBSymDumper &Dumper) const {
+ Dumper.dump(*this);
}