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 //===----------------------------------------------------------------------===//
12 #include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
13 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
14 #include "llvm/DebugInfo/PDB/IPDBSession.h"
15 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
16 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
17 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
21 PDBSymbolTypeFunctionSig::PDBSymbolTypeFunctionSig(
22 const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
23 : PDBSymbol(PDBSession, std::move(Symbol)) {}
25 void PDBSymbolTypeFunctionSig::dump(raw_ostream &OS, int Indent,
26 PDB_DumpLevel Level) const {
27 OS << stream_indent(Indent);
29 uint32_t ReturnTypeId = getTypeId();
30 if (auto ReturnType = Session.getSymbolById(ReturnTypeId)) {
31 ReturnType->dump(OS, 0, PDB_DumpLevel::Compact);
34 // TODO: We need a way to detect if this is a pointer to function so that we
35 // can print the * between the return type and the argument list. The only
36 // way to do this is to pass the parent into this function, but that will
37 // require a larger interface change.
38 OS << getCallingConvention() << " ";
39 uint32_t ClassId = getClassParentId();
41 if (auto ClassParent = Session.getSymbolById(ClassId)) {
43 ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
49 if (auto ChildEnum = findAllChildren<PDBSymbolTypeFunctionArg>()) {
51 while (auto Arg = ChildEnum->getNext()) {
52 Arg->dump(OS, 0, PDB_DumpLevel::Compact);
53 if (++Index < ChildEnum->getChildCount())