1 //===- PDBSymbolTypeFunctionSig.cpp - --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
11 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
12 #include "llvm/DebugInfo/PDB/IPDBSession.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
15 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
20 PDBSymbolTypeFunctionSig::PDBSymbolTypeFunctionSig(
21 const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
22 : PDBSymbol(PDBSession, std::move(Symbol)) {}
24 void PDBSymbolTypeFunctionSig::dump(raw_ostream &OS, int Indent,
25 PDB_DumpLevel Level) const {
26 OS << stream_indent(Indent);
28 uint32_t ReturnTypeId = getTypeId();
29 if (auto ReturnType = Session.getSymbolById(ReturnTypeId)) {
30 ReturnType->dump(OS, 0, PDB_DumpLevel::Compact);
33 // TODO: We need a way to detect if this is a pointer to function so that we
34 // can print the * between the return type and the argument list. The only
35 // way to do this is to pass the parent into this function, but that will
36 // require a larger interface change.
37 OS << getCallingConvention() << " ";
38 uint32_t ClassId = getClassParentId();
40 if (auto ClassParent = Session.getSymbolById(ClassId)) {
42 ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
48 if (auto ChildEnum = findAllChildren<PDBSymbolTypeFunctionArg>()) {
50 while (auto Arg = ChildEnum->getNext()) {
51 Arg->dump(OS, 0, PDB_DumpLevel::Compact);
52 if (++Index < ChildEnum->getChildCount())