llvm.org GIT mirror llvm / 2adab77
[NativePDB] Add support for reading function signatures. This adds support for parsing function signature records and returning them through the native DIA interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342780 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 11 months ago
19 changed file(s) with 1339 addition(s) and 50 deletion(s). Raw diff Collapse all Expand all
2727 codeview::LazyRandomTypeCollection &TypeCollection,
2828 std::vector Kinds);
2929
30 NativeEnumTypes(NativeSession &Session,
31 std::vector Indices);
32
3033 uint32_t getChildCount() const override;
3134 std::unique_ptr getChildAtIndex(uint32_t Index) const override;
3235 std::unique_ptr getNext() override;
1919 class NativeSession;
2020
2121 class NativeRawSymbol : public IPDBRawSymbol {
22 friend class SymbolCache;
23 virtual void initialize() {}
24
2225 public:
2326 NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag,
2427 SymIndexId SymbolId);
0 //===- NativeTypeFunctionSig.h - info about function signature ---*- C++-*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEFUNCTIONSIG_H
11
12 #include "llvm/ADT/Optional.h"
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/DebugInfo/CodeView/CodeView.h"
15 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
16 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
17 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
18
19 namespace llvm {
20 namespace pdb {
21
22 class NativeTypeUDT;
23
24 class NativeTypeFunctionSig : public NativeRawSymbol {
25 protected:
26 void initialize() override;
27
28 public:
29 NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
30 codeview::TypeIndex TI, codeview::ProcedureRecord Proc);
31
32 NativeTypeFunctionSig(NativeSession &Session, SymIndexId Id,
33 codeview::TypeIndex TI,
34 codeview::MemberFunctionRecord MemberFunc);
35
36 ~NativeTypeFunctionSig() override;
37
38 void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
39 PdbSymbolIdField RecurseIdFields) const override;
40
41 std::unique_ptr
42 findChildren(PDB_SymType Type) const override;
43
44 SymIndexId getClassParentId() const override;
45 PDB_CallingConv getCallingConvention() const override;
46 uint32_t getCount() const override;
47 SymIndexId getTypeId() const override;
48 int32_t getThisAdjust() const override;
49 bool hasConstructor() const override;
50 bool isConstType() const override;
51 bool isConstructorVirtualBase() const override;
52 bool isCxxReturnUdt() const override;
53 bool isUnalignedType() const override;
54 bool isVolatileType() const override;
55
56 private:
57 void initializeArgList(codeview::TypeIndex ArgListTI);
58
59 union {
60 codeview::MemberFunctionRecord MemberFunc;
61 codeview::ProcedureRecord Proc;
62 };
63
64 SymIndexId ClassParentId = 0;
65 codeview::TypeIndex Index;
66 codeview::ArgListRecord ArgList;
67 bool IsMemberFunction = false;
68 };
69
70 } // namespace pdb
71 } // namespace llvm
72
73 #endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEPOINTER_H
None //===- NativeTypePointer.h - info about pointer type ------------------*- C++
1 //-*-===//
0 //===- NativeTypePointer.h - info about pointer type -------------*- C++-*-===//
21 //
32 // The LLVM Compiler Infrastructure
43 //
6767 SymIndexId createSymbol(Args &&... ConstructorArgs) {
6868 SymIndexId Id = Cache.size();
6969
70 // Initial construction must not access the cache, since it must be done
71 // atomically.
7072 auto Result = llvm::make_unique(
7173 Session, Id, std::forward(ConstructorArgs)...);
74 Result->SymbolId = Id;
75
76 NativeRawSymbol *NRS = static_cast(Result.get());
7277 Cache.push_back(std::move(Result));
78
79 // After the item is in the cache, we can do further initialization which
80 // is then allowed to access the cache.
81 NRS->initialize();
7382 return Id;
7483 }
7584
8897 SymIndexId SymId = Cache.size();
8998 std::pair Key{FieldListTI, Index};
9099 auto Result = FieldListMembersToSymbolId.try_emplace(Key, SymId);
91 if (Result.second) {
92 auto NewSymbol = llvm::make_unique(
93 Session, SymId, std::forward(ConstructorArgs)...);
94 Cache.push_back(std::move(NewSymbol));
95 } else {
100 if (Result.second)
101 SymId =
102 createSymbol(std::forward(ConstructorArgs)...);
103 else
96104 SymId = Result.first->second;
97 }
98105 return SymId;
99106 }
100107
5353 Native/NativeSymbolEnumerator.cpp
5454 Native/NativeTypeBuiltin.cpp
5555 Native/NativeTypeEnum.cpp
56 Native/NativeTypeFunctionSig.cpp
5657 Native/NativeTypePointer.cpp
5758 Native/NativeTypeUDT.cpp
5859 Native/NamedStreamMap.cpp
244244 RAW_METHOD_DUMP(OS, baseSymbolId);
245245 RAW_METHOD_DUMP_AS(OS, baseType, PDB_BuiltinType);
246246 RAW_METHOD_DUMP(OS, bitPosition);
247 RAW_METHOD_DUMP(OS, callingConvention);
247 RAW_METHOD_DUMP_AS(OS, callingConvention, PDB_CallingConv);
248248 RAW_ID_METHOD_DUMP(OS, classParentId, Session, PdbSymbolIdField::ClassParent,
249249 ShowIdFields, RecurseIdFields);
250250 RAW_METHOD_DUMP(OS, compilerName);
4747 }
4848 }
4949
50 NativeEnumTypes::NativeEnumTypes(NativeSession &PDBSession,
51 std::vector Indices)
52 : Matches(std::move(Indices)), Index(0), Session(PDBSession) {}
53
5054 uint32_t NativeEnumTypes::getChildCount() const {
5155 return static_cast(Matches.size());
5256 }
5357
54 std::unique_ptr
55 NativeEnumTypes::getChildAtIndex(uint32_t Index) const {
56 if (Index < Matches.size()) {
57 SymIndexId Id =
58 Session.getSymbolCache().findSymbolByTypeIndex(Matches[Index]);
58 std::unique_ptr NativeEnumTypes::getChildAtIndex(uint32_t N) const {
59 if (N < Matches.size()) {
60 SymIndexId Id = Session.getSymbolCache().findSymbolByTypeIndex(Matches[N]);
5961 return Session.getSymbolCache().getSymbolById(Id);
6062 }
6163 return nullptr;
4848 return Session.getSymbolCache().createTypeEnumerator(
4949 {codeview::LF_STRUCTURE, codeview::LF_CLASS, codeview::LF_UNION,
5050 codeview::LF_INTERFACE});
51 case PDB_SymType::FunctionSig:
52 return Session.getSymbolCache().createTypeEnumerator(
53 {codeview::LF_PROCEDURE, codeview::LF_MFUNCTION});
54
5155 default:
5256 break;
5357 }
99 #include "llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h"
1010 #include "llvm/Support/FormatVariadic.h"
1111
12 namespace llvm {
13 namespace pdb {
12 using namespace llvm;
13 using namespace llvm::codeview;
14 using namespace llvm::pdb;
1415
1516 NativeTypeBuiltin::NativeTypeBuiltin(NativeSession &PDBSession, SymIndexId Id,
16 codeview::ModifierOptions Mods,
17 PDB_BuiltinType T, uint64_t L)
17 ModifierOptions Mods, PDB_BuiltinType T,
18 uint64_t L)
1819 : NativeRawSymbol(PDBSession, PDB_SymType::BuiltinType, Id),
1920 Session(PDBSession), Mods(Mods), Type(T), Length(L) {}
2021
3031
3132 PDB_BuiltinType NativeTypeBuiltin::getBuiltinType() const { return Type; }
3233
33 bool NativeTypeBuiltin::isConstType() const { return false; }
34 bool NativeTypeBuiltin::isConstType() const {
35 return (Mods & ModifierOptions::Const) != ModifierOptions::None;
36 }
3437
3538 uint64_t NativeTypeBuiltin::getLength() const { return Length; }
3639
37 bool NativeTypeBuiltin::isUnalignedType() const { return false; }
40 bool NativeTypeBuiltin::isUnalignedType() const {
41 return (Mods & ModifierOptions::Unaligned) != ModifierOptions::None;
42 }
3843
39 bool NativeTypeBuiltin::isVolatileType() const { return false; }
40
41 } // namespace pdb
42 } // namespace llvm
44 bool NativeTypeBuiltin::isVolatileType() const {
45 return (Mods & ModifierOptions::Volatile) != ModifierOptions::None;
46 }
0 //===- NativeTypeFunctionSig.cpp - info about function signature -*- C++-*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h"
10
11 #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
12 #include "llvm/DebugInfo/PDB/Native/NativeEnumTypes.h"
13 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
14 #include "llvm/DebugInfo/PDB/Native/TpiStream.h"
15
16 using namespace llvm;
17 using namespace llvm::codeview;
18 using namespace llvm::pdb;
19
20 namespace {
21 // This is kind of a silly class, hence why we keep it private to the file.
22 // It's only purpose is to wrap the real type record. I guess this is so that
23 // we can have the lexical parent point to the function instead of the global
24 // scope.
25 class NativeTypeFunctionArg : public NativeRawSymbol {
26 public:
27 NativeTypeFunctionArg(NativeSession &Session,
28 std::unique_ptr RealType)
29 : NativeRawSymbol(Session, PDB_SymType::FunctionArg, 0),
30 RealType(std::move(RealType)) {}
31
32 void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields,
33 PdbSymbolIdField RecurseIdFields) const override {
34 NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
35
36 dumpSymbolIdField(OS, "typeId", getTypeId(), Indent, Session,
37 PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
38 }
39
40 SymIndexId getTypeId() const override { return RealType->getSymIndexId(); }
41
42 std::unique_ptr RealType;
43 };
44
45 class NativeEnumFunctionArgs : public IPDBEnumChildren {
46 public:
47 NativeEnumFunctionArgs(NativeSession &Session,
48 std::unique_ptr TypeEnumerator)
49 : Session(Session), TypeEnumerator(std::move(TypeEnumerator)) {}
50
51 uint32_t getChildCount() const override {
52 return TypeEnumerator->getChildCount();
53 }
54 std::unique_ptr getChildAtIndex(uint32_t Index) const override {
55 return wrap(TypeEnumerator->getChildAtIndex(Index));
56 }
57 std::unique_ptr getNext() override {
58 return wrap(TypeEnumerator->getNext());
59 }
60
61 void reset() override { TypeEnumerator->reset(); }
62
63 private:
64 std::unique_ptr wrap(std::unique_ptr S) const {
65 if (!S)
66 return nullptr;
67 auto NTFA = llvm::make_unique(Session, std::move(S));
68 return PDBSymbol::create(Session, std::move(NTFA));
69 }
70 NativeSession &Session;
71 std::unique_ptr TypeEnumerator;
72 };
73 } // namespace
74
75 NativeTypeFunctionSig::NativeTypeFunctionSig(NativeSession &Session,
76 SymIndexId Id,
77 codeview::TypeIndex Index,
78 codeview::ProcedureRecord Proc)
79 : NativeRawSymbol(Session, PDB_SymType::FunctionSig, Id),
80 Proc(std::move(Proc)), Index(Index), IsMemberFunction(false) {}
81
82 NativeTypeFunctionSig::NativeTypeFunctionSig(
83 NativeSession &Session, SymIndexId Id, codeview::TypeIndex Index,
84 codeview::MemberFunctionRecord MemberFunc)
85 : NativeRawSymbol(Session, PDB_SymType::FunctionSig, Id),
86 MemberFunc(std::move(MemberFunc)), Index(Index), IsMemberFunction(true) {}
87
88 void NativeTypeFunctionSig::initialize() {
89 if (IsMemberFunction) {
90 ClassParentId =
91 Session.getSymbolCache().findSymbolByTypeIndex(MemberFunc.ClassType);
92 initializeArgList(MemberFunc.ArgumentList);
93 } else {
94 initializeArgList(Proc.ArgumentList);
95 }
96 }
97
98 NativeTypeFunctionSig::~NativeTypeFunctionSig() {}
99
100 void NativeTypeFunctionSig::initializeArgList(codeview::TypeIndex ArgListTI) {
101 TpiStream &Tpi = cantFail(Session.getPDBFile().getPDBTpiStream());
102 CVType CVT = Tpi.typeCollection().getType(ArgListTI);
103
104 cantFail(TypeDeserializer::deserializeAs(CVT, ArgList));
105 }
106
107 void NativeTypeFunctionSig::dump(raw_ostream &OS, int Indent,
108 PdbSymbolIdField ShowIdFields,
109 PdbSymbolIdField RecurseIdFields) const {
110
111 NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
112
113 dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
114 PdbSymbolIdField::LexicalParent, ShowIdFields,
115 RecurseIdFields);
116
117 dumpSymbolField(OS, "callingConvention", getCallingConvention(), Indent);
118 dumpSymbolField(OS, "count", getCount(), Indent);
119 dumpSymbolIdField(OS, "typeId", getTypeId(), Indent, Session,
120 PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
121 if (IsMemberFunction)
122 dumpSymbolField(OS, "thisAdjust", getThisAdjust(), Indent);
123 dumpSymbolField(OS, "constructor", hasConstructor(), Indent);
124 dumpSymbolField(OS, "constType", isConstType(), Indent);
125 dumpSymbolField(OS, "isConstructorVirtualBase", isConstructorVirtualBase(),
126 Indent);
127 dumpSymbolField(OS, "isCxxReturnUdt", isCxxReturnUdt(), Indent);
128 dumpSymbolField(OS, "unalignedType", isUnalignedType(), Indent);
129 dumpSymbolField(OS, "volatileType", isVolatileType(), Indent);
130 }
131
132 std::unique_ptr
133 NativeTypeFunctionSig::findChildren(PDB_SymType Type) const {
134 if (Type != PDB_SymType::FunctionArg)
135 return llvm::make_unique>();
136
137 auto NET = llvm::make_unique(Session,
138 /* copy */ ArgList.ArgIndices);
139 return std::unique_ptr(
140 new NativeEnumFunctionArgs(Session, std::move(NET)));
141 }
142
143 SymIndexId NativeTypeFunctionSig::getClassParentId() const {
144 if (!IsMemberFunction)
145 return 0;
146
147 return ClassParentId;
148 }
149
150 PDB_CallingConv NativeTypeFunctionSig::getCallingConvention() const {
151 return IsMemberFunction ? MemberFunc.CallConv : Proc.CallConv;
152 }
153
154 uint32_t NativeTypeFunctionSig::getCount() const {
155 return IsMemberFunction ? (1 + MemberFunc.getParameterCount())
156 : Proc.getParameterCount();
157 }
158
159 SymIndexId NativeTypeFunctionSig::getTypeId() const {
160 TypeIndex ReturnTI =
161 IsMemberFunction ? MemberFunc.getReturnType() : Proc.getReturnType();
162
163 return Session.getSymbolCache().findSymbolByTypeIndex(ReturnTI);
164 }
165
166 int32_t NativeTypeFunctionSig::getThisAdjust() const {
167 return IsMemberFunction ? MemberFunc.getThisPointerAdjustment() : 0;
168 }
169
170 bool NativeTypeFunctionSig::hasConstructor() const {
171 if (!IsMemberFunction)
172 return false;
173
174 return (MemberFunc.getOptions() & FunctionOptions::Constructor) !=
175 FunctionOptions::None;
176 }
177
178 bool NativeTypeFunctionSig::isConstType() const { return false; }
179
180 bool NativeTypeFunctionSig::isConstructorVirtualBase() const {
181 if (!IsMemberFunction)
182 return false;
183
184 return (MemberFunc.getOptions() &
185 FunctionOptions::ConstructorWithVirtualBases) !=
186 FunctionOptions::None;
187 }
188
189 bool NativeTypeFunctionSig::isCxxReturnUdt() const {
190 FunctionOptions Options =
191 IsMemberFunction ? MemberFunc.getOptions() : Proc.getOptions();
192 return (Options & FunctionOptions::CxxReturnUdt) != FunctionOptions::None;
193 }
194
195 bool NativeTypeFunctionSig::isUnalignedType() const { return false; }
196
197 bool NativeTypeFunctionSig::isVolatileType() const { return false; }
88 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
99 #include "llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h"
1010 #include "llvm/DebugInfo/PDB/Native/NativeTypeEnum.h"
11 #include "llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h"
1112 #include "llvm/DebugInfo/PDB/Native/NativeTypePointer.h"
1213 #include "llvm/DebugInfo/PDB/Native/NativeTypeUDT.h"
1314 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
2829 uint32_t Size;
2930 } BuiltinTypes[] = {
3031 {codeview::SimpleTypeKind::None, PDB_BuiltinType::None, 0},
32 {codeview::SimpleTypeKind::Void, PDB_BuiltinType::Void, 0},
3133 {codeview::SimpleTypeKind::Int16Short, PDB_BuiltinType::Int, 2},
3234 {codeview::SimpleTypeKind::UInt16Short, PDB_BuiltinType::UInt, 2},
3335 {codeview::SimpleTypeKind::Int32, PDB_BuiltinType::Int, 4},
7577
7678 SymIndexId SymbolCache::createSimpleType(TypeIndex Index,
7779 ModifierOptions Mods) {
78 if (Index.getSimpleMode() != codeview::SimpleTypeMode::Direct) {
79 SymIndexId Id = Cache.size();
80 Cache.emplace_back(
81 llvm::make_unique(Session, Id, Index));
82 return Id;
83 }
84
85 SymIndexId Id = Cache.size();
80 if (Index.getSimpleMode() != codeview::SimpleTypeMode::Direct)
81 return createSymbol(Index);
82
8683 const auto Kind = Index.getSimpleKind();
8784 const auto It = std::find_if(
8885 std::begin(BuiltinTypes), std::end(BuiltinTypes),
8986 [Kind](const BuiltinTypeEntry &Builtin) { return Builtin.Kind == Kind; });
9087 if (It == std::end(BuiltinTypes))
9188 return 0;
92 Cache.emplace_back(llvm::make_unique(Session, Id, Mods,
93 It->Type, It->Size));
94 TypeIndexToSymbolId[Index] = Id;
95 return Id;
89 return createSymbol(Mods, It->Type, It->Size);
9690 }
9791
9892 SymIndexId
134128 return Entry->second;
135129
136130 // Symbols for built-in types are created on the fly.
137 if (Index.isSimple())
138 return createSimpleType(Index, ModifierOptions::None);
131 if (Index.isSimple()) {
132 SymIndexId Result = createSimpleType(Index, ModifierOptions::None);
133 assert(TypeIndexToSymbolId.count(Index) == 0);
134 TypeIndexToSymbolId[Index] = Result;
135 return Result;
136 }
139137
140138 // We need to instantiate and cache the desired type symbol.
141139 auto Tpi = Session.getPDBFile().getPDBTpiStream();
156154 SymIndexId Result = findSymbolByTypeIndex(*EFD);
157155 // Record a mapping from ForwardRef -> SymIndex of complete type so that
158156 // we'll take the fast path next time.
157 assert(TypeIndexToSymbolId.count(Index) == 0);
159158 TypeIndexToSymbolId[Index] = Result;
160159 return Result;
161160 }
183182 case codeview::LF_MODIFIER:
184183 Id = createSymbolForModifiedType(Index, std::move(CVT));
185184 break;
185 case codeview::LF_PROCEDURE:
186 Id = createSymbolForType(
187 Index, std::move(CVT));
188 break;
189 case codeview::LF_MFUNCTION:
190 Id = createSymbolForType(
191 Index, std::move(CVT));
192 break;
186193 default:
187194 Id = createSymbolPlaceholder();
188195 break;
189196 }
190 if (Id != 0)
197 if (Id != 0) {
198 assert(TypeIndexToSymbolId.count(Index) == 0);
191199 TypeIndexToSymbolId[Index] = Id;
200 }
192201 return Id;
193202 }
194203
0 // Build with "cl.exe /Zi /GR- /GS- -EHs-c- every-function.cpp /link /debug /nodefaultlib /incremental:no /entry:main"
1 // Getting functions with the correct calling conventions requires building in x86.
2
3 // clang-format off
4 void *__purecall = 0;
5
6 void __cdecl operator delete(void *,unsigned int) {}
7 void __cdecl operator delete(void *,unsigned __int64) {}
8
9 // All calling conventions that appear in normal code.
10 int __cdecl cc_cdecl() { return 42; }
11 int __stdcall cc_stdcall() { return 42; }
12 int __fastcall cc_fastcall() { return 42; }
13 int __vectorcall cc_vectorcall() { return 42; }
14
15
16 struct Struct {
17 Struct() {} // constructor
18
19 int __thiscall cc_thiscall() { return 42; }
20
21 void M() { }
22 void CM() const { }
23 void VM() volatile { }
24 void CVM() const volatile { }
25 };
26
27 int builtin_one_param(int x) { return 42; }
28 int builtin_two_params(int x, char y) { return 42; }
29
30 void struct_one_param(Struct S) { }
31
32 void modified_builtin_param(const int X) { }
33 void modified_struct_param(const Struct S) { }
34
35 void pointer_builtin_param(int *X) { }
36 void pointer_struct_param(Struct *S) { }
37
38
39 void modified_pointer_builtin_param(const int *X) { }
40 void modified_pointer_struct_param(const Struct *S) { }
41
42 Struct rvo() { return Struct(); }
43
44 struct Base1 {
45 virtual ~Base1() {}
46 };
47
48 struct Base2 : public virtual Base1 { };
49
50 struct Derived : public virtual Base1, public Base2 {
51 };
52
53
54 int main() {
55 cc_cdecl();
56 cc_stdcall();
57 cc_fastcall();
58 Struct().cc_thiscall();
59 cc_vectorcall();
60
61 builtin_one_param(42);
62 builtin_two_params(42, 'x');
63 struct_one_param(Struct{});
64
65 modified_builtin_param(42);
66 modified_struct_param(Struct());
67
68 pointer_builtin_param(nullptr);
69 pointer_struct_param(nullptr);
70
71
72 modified_pointer_builtin_param(nullptr);
73 modified_pointer_struct_param(nullptr);
74
75 Struct S = rvo();
76
77 Derived D;
78 return 42;
79 }
0 ; Test that the native PDB reader can enumerate pointer types. The output
1 ; being checked against is golden output generated by llvm-pdbutil without
2 ; the -native flag. Then we check that we generate the same output.
3
4 ; RUN: llvm-pdbutil pretty -native -funcsigs %p/../Inputs/every-function.pdb \
5 ; RUN: | FileCheck -check-prefix=PRETTY %s
6
7 ; RUN: llvm-pdbutil diadump -native -funcsigs %p/../Inputs/every-function.pdb \
8 ; RUN: | FileCheck -check-prefix=DUMP %s
9
10
11 ; PRETTY: void __cdecl (void*, unsigned int)
12 ; PRETTY-NEXT: void __cdecl (void*, unsigned __int64)
13 ; PRETTY-NEXT: int __cdecl ()
14 ; PRETTY-NEXT: int ()
15 ; PRETTY-NEXT: int __fastcall ()
16 ; PRETTY-NEXT: int __vectorcall ()
17 ; PRETTY-NEXT: int __cdecl (int)
18 ; PRETTY-NEXT: int __cdecl (int, char)
19 ; PRETTY-NEXT: void __cdecl (Struct)
20 ; PRETTY-NEXT: void (Struct::)()
21 ; PRETTY-NEXT: int (Struct::)()
22 ; PRETTY-NEXT: void (Struct::)()
23 ; PRETTY-NEXT: void (Struct::)()
24 ; PRETTY-NEXT: void (Struct::)()
25 ; PRETTY-NEXT: void (Struct::)()
26 ; PRETTY-NEXT: void __cdecl (const int)
27 ; PRETTY-NEXT: void __cdecl (Struct)
28 ; PRETTY-NEXT: void __cdecl (int*)
29 ; PRETTY-NEXT: void __cdecl (Struct*)
30 ; PRETTY-NEXT: void __cdecl (const int*)
31 ; PRETTY-NEXT: void __cdecl (Struct*)
32 ; PRETTY-NEXT: Struct __cdecl ()
33 ; PRETTY-NEXT: void (Derived::)(Derived*)
34 ; PRETTY-NEXT: void (Derived::)(Derived&)
35 ; PRETTY-NEXT: void (Derived::)()
36 ; PRETTY-NEXT: void (Derived::)()
37 ; PRETTY-NEXT: Derived& (Derived::)(Derived*)
38 ; PRETTY-NEXT: Derived& (Derived::)(Derived&)
39 ; PRETTY-NEXT: void (Derived::)()
40 ; PRETTY-NEXT: void* (Derived::)(unsigned int)
41 ; PRETTY-NEXT: void (__vc_attributes::event_sourceAttribute::)(__vc_attributes::event_sourceAttribute::type_e)
42 ; PRETTY-NEXT: void (__vc_attributes::event_sourceAttribute::)()
43 ; PRETTY-NEXT: void (__vc_attributes::helper_attributes::v1_alttypeAttribute::)(__vc_attributes::helper_attributes::v1_alttypeAttribute::type_e)
44 ; PRETTY-NEXT: void (__vc_attributes::helper_attributes::usageAttribute::)(unsigned int)
45 ; PRETTY-NEXT: void (__vc_attributes::threadingAttribute::)(__vc_attributes::threadingAttribute::threading_e)
46 ; PRETTY-NEXT: void (__vc_attributes::threadingAttribute::)()
47 ; PRETTY-NEXT: void (__vc_attributes::aggregatableAttribute::)(__vc_attributes::aggregatableAttribute::type_e)
48 ; PRETTY-NEXT: void (__vc_attributes::aggregatableAttribute::)()
49 ; PRETTY-NEXT: void (__vc_attributes::event_receiverAttribute::)(__vc_attributes::event_receiverAttribute::type_e, bool)
50 ; PRETTY-NEXT: void (__vc_attributes::event_receiverAttribute::)(__vc_attributes::event_receiverAttribute::type_e)
51 ; PRETTY-NEXT: void (__vc_attributes::event_receiverAttribute::)()
52 ; PRETTY-NEXT: void (__vc_attributes::moduleAttribute::)(__vc_attributes::moduleAttribute::type_e, const char*, const char*, const char*, int, bool, const char*, int, const char*, const char*, int, bool, bool, const char*, const char*)
53 ; PRETTY-NEXT: void (__vc_attributes::moduleAttribute::)(__vc_attributes::moduleAttribute::type_e)
54 ; PRETTY-NEXT: void (__vc_attributes::moduleAttribute::)()
55 ; PRETTY-NEXT: void (Base1::)()
56 ; PRETTY-NEXT: void (Base1::)(Base1&)
57 ; PRETTY-NEXT: void (Base1::)()
58 ; PRETTY-NEXT: Base1& (Base1::)(Base1&)
59 ; PRETTY-NEXT: void* (Base1::)(unsigned int)
60 ; PRETTY-NEXT: void (Base2::)(Base2*)
61 ; PRETTY-NEXT: void (Base2::)(Base2&)
62 ; PRETTY-NEXT: void (Base2::)()
63 ; PRETTY-NEXT: void (Base2::)()
64 ; PRETTY-NEXT: Base2& (Base2::)(Base2*)
65 ; PRETTY-NEXT: Base2& (Base2::)(Base2&)
66 ; PRETTY-NEXT: void (Base2::)()
67 ; PRETTY-NEXT: void* (Base2::)(unsigned int)
68 ; PRETTY-NEXT: void __cdecl ()
69
70 ; DUMP: {
71 ; DUMP-NEXT: symIndexId: 2
72 ; DUMP-NEXT: symTag: FunctionSig
73 ; DUMP-NEXT: callingConvention: __cdecl
74 ; DUMP-NEXT: count: 2
75 ; DUMP-NEXT: typeId: 3
76 ; DUMP-NEXT: constructor: 0
77 ; DUMP-NEXT: constType: 0
78 ; DUMP-NEXT: isConstructorVirtualBase: 0
79 ; DUMP-NEXT: isCxxReturnUdt: 0
80 ; DUMP-NEXT: unalignedType: 0
81 ; DUMP-NEXT: volatileType: 0
82 ; DUMP-NEXT: }
83 ; DUMP-NEXT: {
84 ; DUMP-NEXT: symIndexId: 4
85 ; DUMP-NEXT: symTag: FunctionSig
86 ; DUMP-NEXT: callingConvention: __cdecl
87 ; DUMP-NEXT: count: 2
88 ; DUMP-NEXT: typeId: 3
89 ; DUMP-NEXT: constructor: 0
90 ; DUMP-NEXT: constType: 0
91 ; DUMP-NEXT: isConstructorVirtualBase: 0
92 ; DUMP-NEXT: isCxxReturnUdt: 0
93 ; DUMP-NEXT: unalignedType: 0
94 ; DUMP-NEXT: volatileType: 0
95 ; DUMP-NEXT: }
96 ; DUMP-NEXT: {
97 ; DUMP-NEXT: symIndexId: 5
98 ; DUMP-NEXT: symTag: FunctionSig
99 ; DUMP-NEXT: callingConvention: __cdecl
100 ; DUMP-NEXT: count: 0
101 ; DUMP-NEXT: typeId: 6
102 ; DUMP-NEXT: constructor: 0
103 ; DUMP-NEXT: constType: 0
104 ; DUMP-NEXT: isConstructorVirtualBase: 0
105 ; DUMP-NEXT: isCxxReturnUdt: 0
106 ; DUMP-NEXT: unalignedType: 0
107 ; DUMP-NEXT: volatileType: 0
108 ; DUMP-NEXT: }
109 ; DUMP-NEXT: {
110 ; DUMP-NEXT: symIndexId: 7
111 ; DUMP-NEXT: symTag: FunctionSig
112 ; DUMP-NEXT: callingConvention: __stdcall
113 ; DUMP-NEXT: count: 0
114 ; DUMP-NEXT: typeId: 6
115 ; DUMP-NEXT: constructor: 0
116 ; DUMP-NEXT: constType: 0
117 ; DUMP-NEXT: isConstructorVirtualBase: 0
118 ; DUMP-NEXT: isCxxReturnUdt: 0
119 ; DUMP-NEXT: unalignedType: 0
120 ; DUMP-NEXT: volatileType: 0
121 ; DUMP-NEXT: }
122 ; DUMP-NEXT: {
123 ; DUMP-NEXT: symIndexId: 8
124 ; DUMP-NEXT: symTag: FunctionSig
125 ; DUMP-NEXT: callingConvention: __fastcall
126 ; DUMP-NEXT: count: 0
127 ; DUMP-NEXT: typeId: 6
128 ; DUMP-NEXT: constructor: 0
129 ; DUMP-NEXT: constType: 0
130 ; DUMP-NEXT: isConstructorVirtualBase: 0
131 ; DUMP-NEXT: isCxxReturnUdt: 0
132 ; DUMP-NEXT: unalignedType: 0
133 ; DUMP-NEXT: volatileType: 0
134 ; DUMP-NEXT: }
135 ; DUMP-NEXT: {
136 ; DUMP-NEXT: symIndexId: 9
137 ; DUMP-NEXT: symTag: FunctionSig
138 ; DUMP-NEXT: callingConvention: __vectorcall
139 ; DUMP-NEXT: count: 0
140 ; DUMP-NEXT: typeId: 6
141 ; DUMP-NEXT: constructor: 0
142 ; DUMP-NEXT: constType: 0
143 ; DUMP-NEXT: isConstructorVirtualBase: 0
144 ; DUMP-NEXT: isCxxReturnUdt: 0
145 ; DUMP-NEXT: unalignedType: 0
146 ; DUMP-NEXT: volatileType: 0
147 ; DUMP-NEXT: }
148 ; DUMP-NEXT: {
149 ; DUMP-NEXT: symIndexId: 10
150 ; DUMP-NEXT: symTag: FunctionSig
151 ; DUMP-NEXT: callingConvention: __cdecl
152 ; DUMP-NEXT: count: 1
153 ; DUMP-NEXT: typeId: 6
154 ; DUMP-NEXT: constructor: 0
155 ; DUMP-NEXT: constType: 0
156 ; DUMP-NEXT: isConstructorVirtualBase: 0
157 ; DUMP-NEXT: isCxxReturnUdt: 0
158 ; DUMP-NEXT: unalignedType: 0
159 ; DUMP-NEXT: volatileType: 0
160 ; DUMP-NEXT: }
161 ; DUMP-NEXT: {
162 ; DUMP-NEXT: symIndexId: 11
163 ; DUMP-NEXT: symTag: FunctionSig
164 ; DUMP-NEXT: callingConvention: __cdecl
165 ; DUMP-NEXT: count: 2
166 ; DUMP-NEXT: typeId: 6
167 ; DUMP-NEXT: constructor: 0
168 ; DUMP-NEXT: constType: 0
169 ; DUMP-NEXT: isConstructorVirtualBase: 0
170 ; DUMP-NEXT: isCxxReturnUdt: 0
171 ; DUMP-NEXT: unalignedType: 0
172 ; DUMP-NEXT: volatileType: 0
173 ; DUMP-NEXT: }
174 ; DUMP-NEXT: {
175 ; DUMP-NEXT: symIndexId: 12
176 ; DUMP-NEXT: symTag: FunctionSig
177 ; DUMP-NEXT: callingConvention: __cdecl
178 ; DUMP-NEXT: count: 1
179 ; DUMP-NEXT: typeId: 3
180 ; DUMP-NEXT: constructor: 0
181 ; DUMP-NEXT: constType: 0
182 ; DUMP-NEXT: isConstructorVirtualBase: 0
183 ; DUMP-NEXT: isCxxReturnUdt: 0
184 ; DUMP-NEXT: unalignedType: 0
185 ; DUMP-NEXT: volatileType: 0
186 ; DUMP-NEXT: }
187 ; DUMP-NEXT: {
188 ; DUMP-NEXT: symIndexId: 13
189 ; DUMP-NEXT: symTag: FunctionSig
190 ; DUMP-NEXT: callingConvention: __thiscall
191 ; DUMP-NEXT: count: 1
192 ; DUMP-NEXT: typeId: 3
193 ; DUMP-NEXT: thisAdjust: 0
194 ; DUMP-NEXT: constructor: 1
195 ; DUMP-NEXT: constType: 0
196 ; DUMP-NEXT: isConstructorVirtualBase: 0
197 ; DUMP-NEXT: isCxxReturnUdt: 0
198 ; DUMP-NEXT: unalignedType: 0
199 ; DUMP-NEXT: volatileType: 0
200 ; DUMP-NEXT: }
201 ; DUMP-NEXT: {
202 ; DUMP-NEXT: symIndexId: 15
203 ; DUMP-NEXT: symTag: FunctionSig
204 ; DUMP-NEXT: callingConvention: __thiscall
205 ; DUMP-NEXT: count: 1
206 ; DUMP-NEXT: typeId: 6
207 ; DUMP-NEXT: thisAdjust: 0
208 ; DUMP-NEXT: constructor: 0
209 ; DUMP-NEXT: constType: 0
210 ; DUMP-NEXT: isConstructorVirtualBase: 0
211 ; DUMP-NEXT: isCxxReturnUdt: 0
212 ; DUMP-NEXT: unalignedType: 0
213 ; DUMP-NEXT: volatileType: 0
214 ; DUMP-NEXT: }
215 ; DUMP-NEXT: {
216 ; DUMP-NEXT: symIndexId: 16
217 ; DUMP-NEXT: symTag: FunctionSig
218 ; DUMP-NEXT: callingConvention: __thiscall
219 ; DUMP-NEXT: count: 1
220 ; DUMP-NEXT: typeId: 3
221 ; DUMP-NEXT: thisAdjust: 0
222 ; DUMP-NEXT: constructor: 0
223 ; DUMP-NEXT: constType: 0
224 ; DUMP-NEXT: isConstructorVirtualBase: 0
225 ; DUMP-NEXT: isCxxReturnUdt: 0
226 ; DUMP-NEXT: unalignedType: 0
227 ; DUMP-NEXT: volatileType: 0
228 ; DUMP-NEXT: }
229 ; DUMP-NEXT: {
230 ; DUMP-NEXT: symIndexId: 17
231 ; DUMP-NEXT: symTag: FunctionSig
232 ; DUMP-NEXT: callingConvention: __thiscall
233 ; DUMP-NEXT: count: 1
234 ; DUMP-NEXT: typeId: 3
235 ; DUMP-NEXT: thisAdjust: 0
236 ; DUMP-NEXT: constructor: 0
237 ; DUMP-NEXT: constType: 0
238 ; DUMP-NEXT: isConstructorVirtualBase: 0
239 ; DUMP-NEXT: isCxxReturnUdt: 0
240 ; DUMP-NEXT: unalignedType: 0
241 ; DUMP-NEXT: volatileType: 0
242 ; DUMP-NEXT: }
243 ; DUMP-NEXT: {
244 ; DUMP-NEXT: symIndexId: 18
245 ; DUMP-NEXT: symTag: FunctionSig
246 ; DUMP-NEXT: callingConvention: __thiscall
247 ; DUMP-NEXT: count: 1
248 ; DUMP-NEXT: typeId: 3
249 ; DUMP-NEXT: thisAdjust: 0
250 ; DUMP-NEXT: constructor: 0
251 ; DUMP-NEXT: constType: 0
252 ; DUMP-NEXT: isConstructorVirtualBase: 0
253 ; DUMP-NEXT: isCxxReturnUdt: 0
254 ; DUMP-NEXT: unalignedType: 0
255 ; DUMP-NEXT: volatileType: 0
256 ; DUMP-NEXT: }
257 ; DUMP-NEXT: {
258 ; DUMP-NEXT: symIndexId: 19
259 ; DUMP-NEXT: symTag: FunctionSig
260 ; DUMP-NEXT: callingConvention: __thiscall
261 ; DUMP-NEXT: count: 1
262 ; DUMP-NEXT: typeId: 3
263 ; DUMP-NEXT: thisAdjust: 0
264 ; DUMP-NEXT: constructor: 0
265 ; DUMP-NEXT: constType: 0
266 ; DUMP-NEXT: isConstructorVirtualBase: 0
267 ; DUMP-NEXT: isCxxReturnUdt: 0
268 ; DUMP-NEXT: unalignedType: 0
269 ; DUMP-NEXT: volatileType: 0
270 ; DUMP-NEXT: }
271 ; DUMP-NEXT: {
272 ; DUMP-NEXT: symIndexId: 20
273 ; DUMP-NEXT: symTag: FunctionSig
274 ; DUMP-NEXT: callingConvention: __cdecl
275 ; DUMP-NEXT: count: 1
276 ; DUMP-NEXT: typeId: 3
277 ; DUMP-NEXT: constructor: 0
278 ; DUMP-NEXT: constType: 0
279 ; DUMP-NEXT: isConstructorVirtualBase: 0
280 ; DUMP-NEXT: isCxxReturnUdt: 0
281 ; DUMP-NEXT: unalignedType: 0
282 ; DUMP-NEXT: volatileType: 0
283 ; DUMP-NEXT: }
284 ; DUMP-NEXT: {
285 ; DUMP-NEXT: symIndexId: 21
286 ; DUMP-NEXT: symTag: FunctionSig
287 ; DUMP-NEXT: callingConvention: __cdecl
288 ; DUMP-NEXT: count: 1
289 ; DUMP-NEXT: typeId: 3
290 ; DUMP-NEXT: constructor: 0
291 ; DUMP-NEXT: constType: 0
292 ; DUMP-NEXT: isConstructorVirtualBase: 0
293 ; DUMP-NEXT: isCxxReturnUdt: 0
294 ; DUMP-NEXT: unalignedType: 0
295 ; DUMP-NEXT: volatileType: 0
296 ; DUMP-NEXT: }
297 ; DUMP-NEXT: {
298 ; DUMP-NEXT: symIndexId: 22
299 ; DUMP-NEXT: symTag: FunctionSig
300 ; DUMP-NEXT: callingConvention: __cdecl
301 ; DUMP-NEXT: count: 1
302 ; DUMP-NEXT: typeId: 3
303 ; DUMP-NEXT: constructor: 0
304 ; DUMP-NEXT: constType: 0
305 ; DUMP-NEXT: isConstructorVirtualBase: 0
306 ; DUMP-NEXT: isCxxReturnUdt: 0
307 ; DUMP-NEXT: unalignedType: 0
308 ; DUMP-NEXT: volatileType: 0
309 ; DUMP-NEXT: }
310 ; DUMP-NEXT: {
311 ; DUMP-NEXT: symIndexId: 23
312 ; DUMP-NEXT: symTag: FunctionSig
313 ; DUMP-NEXT: callingConvention: __cdecl
314 ; DUMP-NEXT: count: 1
315 ; DUMP-NEXT: typeId: 3
316 ; DUMP-NEXT: constructor: 0
317 ; DUMP-NEXT: constType: 0
318 ; DUMP-NEXT: isConstructorVirtualBase: 0
319 ; DUMP-NEXT: isCxxReturnUdt: 0
320 ; DUMP-NEXT: unalignedType: 0
321 ; DUMP-NEXT: volatileType: 0
322 ; DUMP-NEXT: }
323 ; DUMP-NEXT: {
324 ; DUMP-NEXT: symIndexId: 24
325 ; DUMP-NEXT: symTag: FunctionSig
326 ; DUMP-NEXT: callingConvention: __cdecl
327 ; DUMP-NEXT: count: 1
328 ; DUMP-NEXT: typeId: 3
329 ; DUMP-NEXT: constructor: 0
330 ; DUMP-NEXT: constType: 0
331 ; DUMP-NEXT: isConstructorVirtualBase: 0
332 ; DUMP-NEXT: isCxxReturnUdt: 0
333 ; DUMP-NEXT: unalignedType: 0
334 ; DUMP-NEXT: volatileType: 0
335 ; DUMP-NEXT: }
336 ; DUMP-NEXT: {
337 ; DUMP-NEXT: symIndexId: 25
338 ; DUMP-NEXT: symTag: FunctionSig
339 ; DUMP-NEXT: callingConvention: __cdecl
340 ; DUMP-NEXT: count: 1
341 ; DUMP-NEXT: typeId: 3
342 ; DUMP-NEXT: constructor: 0
343 ; DUMP-NEXT: constType: 0
344 ; DUMP-NEXT: isConstructorVirtualBase: 0
345 ; DUMP-NEXT: isCxxReturnUdt: 0
346 ; DUMP-NEXT: unalignedType: 0
347 ; DUMP-NEXT: volatileType: 0
348 ; DUMP-NEXT: }
349 ; DUMP-NEXT: {
350 ; DUMP-NEXT: symIndexId: 26
351 ; DUMP-NEXT: symTag: FunctionSig
352 ; DUMP-NEXT: callingConvention: __cdecl
353 ; DUMP-NEXT: count: 0
354 ; DUMP-NEXT: typeId: 14
355 ; DUMP-NEXT: constructor: 0
356 ; DUMP-NEXT: constType: 0
357 ; DUMP-NEXT: isConstructorVirtualBase: 0
358 ; DUMP-NEXT: isCxxReturnUdt: 1
359 ; DUMP-NEXT: unalignedType: 0
360 ; DUMP-NEXT: volatileType: 0
361 ; DUMP-NEXT: }
362 ; DUMP-NEXT: {
363 ; DUMP-NEXT: symIndexId: 27
364 ; DUMP-NEXT: symTag: FunctionSig
365 ; DUMP-NEXT: callingConvention: __thiscall
366 ; DUMP-NEXT: count: 2
367 ; DUMP-NEXT: typeId: 3
368 ; DUMP-NEXT: thisAdjust: 0
369 ; DUMP-NEXT: constructor: 1
370 ; DUMP-NEXT: constType: 0
371 ; DUMP-NEXT: isConstructorVirtualBase: 1
372 ; DUMP-NEXT: isCxxReturnUdt: 0
373 ; DUMP-NEXT: unalignedType: 0
374 ; DUMP-NEXT: volatileType: 0
375 ; DUMP-NEXT: }
376 ; DUMP-NEXT: {
377 ; DUMP-NEXT: symIndexId: 29
378 ; DUMP-NEXT: symTag: FunctionSig
379 ; DUMP-NEXT: callingConvention: __thiscall
380 ; DUMP-NEXT: count: 2
381 ; DUMP-NEXT: typeId: 3
382 ; DUMP-NEXT: thisAdjust: 0
383 ; DUMP-NEXT: constructor: 1
384 ; DUMP-NEXT: constType: 0
385 ; DUMP-NEXT: isConstructorVirtualBase: 1
386 ; DUMP-NEXT: isCxxReturnUdt: 0
387 ; DUMP-NEXT: unalignedType: 0
388 ; DUMP-NEXT: volatileType: 0
389 ; DUMP-NEXT: }
390 ; DUMP-NEXT: {
391 ; DUMP-NEXT: symIndexId: 30
392 ; DUMP-NEXT: symTag: FunctionSig
393 ; DUMP-NEXT: callingConvention: __thiscall
394 ; DUMP-NEXT: count: 1
395 ; DUMP-NEXT: typeId: 3
396 ; DUMP-NEXT: thisAdjust: 0
397 ; DUMP-NEXT: constructor: 1
398 ; DUMP-NEXT: constType: 0
399 ; DUMP-NEXT: isConstructorVirtualBase: 1
400 ; DUMP-NEXT: isCxxReturnUdt: 0
401 ; DUMP-NEXT: unalignedType: 0
402 ; DUMP-NEXT: volatileType: 0
403 ; DUMP-NEXT: }
404 ; DUMP-NEXT: {
405 ; DUMP-NEXT: symIndexId: 31
406 ; DUMP-NEXT: symTag: FunctionSig
407 ; DUMP-NEXT: callingConvention: __thiscall
408 ; DUMP-NEXT: count: 1
409 ; DUMP-NEXT: typeId: 3
410 ; DUMP-NEXT: thisAdjust: 4
411 ; DUMP-NEXT: constructor: 0
412 ; DUMP-NEXT: constType: 0
413 ; DUMP-NEXT: isConstructorVirtualBase: 0
414 ; DUMP-NEXT: isCxxReturnUdt: 0
415 ; DUMP-NEXT: unalignedType: 0
416 ; DUMP-NEXT: volatileType: 0
417 ; DUMP-NEXT: }
418 ; DUMP-NEXT: {
419 ; DUMP-NEXT: symIndexId: 32
420 ; DUMP-NEXT: symTag: FunctionSig
421 ; DUMP-NEXT: callingConvention: __thiscall
422 ; DUMP-NEXT: count: 2
423 ; DUMP-NEXT: typeId: 33
424 ; DUMP-NEXT: thisAdjust: 0
425 ; DUMP-NEXT: constructor: 0
426 ; DUMP-NEXT: constType: 0
427 ; DUMP-NEXT: isConstructorVirtualBase: 0
428 ; DUMP-NEXT: isCxxReturnUdt: 0
429 ; DUMP-NEXT: unalignedType: 0
430 ; DUMP-NEXT: volatileType: 0
431 ; DUMP-NEXT: }
432 ; DUMP-NEXT: {
433 ; DUMP-NEXT: symIndexId: 34
434 ; DUMP-NEXT: symTag: FunctionSig
435 ; DUMP-NEXT: callingConvention: __thiscall
436 ; DUMP-NEXT: count: 2
437 ; DUMP-NEXT: typeId: 33
438 ; DUMP-NEXT: thisAdjust: 0
439 ; DUMP-NEXT: constructor: 0
440 ; DUMP-NEXT: constType: 0
441 ; DUMP-NEXT: isConstructorVirtualBase: 0
442 ; DUMP-NEXT: isCxxReturnUdt: 0
443 ; DUMP-NEXT: unalignedType: 0
444 ; DUMP-NEXT: volatileType: 0
445 ; DUMP-NEXT: }
446 ; DUMP-NEXT: {
447 ; DUMP-NEXT: symIndexId: 35
448 ; DUMP-NEXT: symTag: FunctionSig
449 ; DUMP-NEXT: callingConvention: __thiscall
450 ; DUMP-NEXT: count: 1
451 ; DUMP-NEXT: typeId: 3
452 ; DUMP-NEXT: thisAdjust: 0
453 ; DUMP-NEXT: constructor: 0
454 ; DUMP-NEXT: constType: 0
455 ; DUMP-NEXT: isConstructorVirtualBase: 0
456 ; DUMP-NEXT: isCxxReturnUdt: 0
457 ; DUMP-NEXT: unalignedType: 0
458 ; DUMP-NEXT: volatileType: 0
459 ; DUMP-NEXT: }
460 ; DUMP-NEXT: {
461 ; DUMP-NEXT: symIndexId: 36
462 ; DUMP-NEXT: symTag: FunctionSig
463 ; DUMP-NEXT: callingConvention: __thiscall
464 ; DUMP-NEXT: count: 2
465 ; DUMP-NEXT: typeId: 37
466 ; DUMP-NEXT: thisAdjust: 4
467 ; DUMP-NEXT: constructor: 0
468 ; DUMP-NEXT: constType: 0
469 ; DUMP-NEXT: isConstructorVirtualBase: 0
470 ; DUMP-NEXT: isCxxReturnUdt: 0
471 ; DUMP-NEXT: unalignedType: 0
472 ; DUMP-NEXT: volatileType: 0
473 ; DUMP-NEXT: }
474 ; DUMP-NEXT: {
475 ; DUMP-NEXT: symIndexId: 38
476 ; DUMP-NEXT: symTag: FunctionSig
477 ; DUMP-NEXT: callingConvention: __thiscall
478 ; DUMP-NEXT: count: 2
479 ; DUMP-NEXT: typeId: 3
480 ; DUMP-NEXT: thisAdjust: 0
481 ; DUMP-NEXT: constructor: 1
482 ; DUMP-NEXT: constType: 0
483 ; DUMP-NEXT: isConstructorVirtualBase: 0
484 ; DUMP-NEXT: isCxxReturnUdt: 0
485 ; DUMP-NEXT: unalignedType: 0
486 ; DUMP-NEXT: volatileType: 0
487 ; DUMP-NEXT: }
488 ; DUMP-NEXT: {
489 ; DUMP-NEXT: symIndexId: 40
490 ; DUMP-NEXT: symTag: FunctionSig
491 ; DUMP-NEXT: callingConvention: __thiscall
492 ; DUMP-NEXT: count: 1
493 ; DUMP-NEXT: typeId: 3
494 ; DUMP-NEXT: thisAdjust: 0
495 ; DUMP-NEXT: constructor: 1
496 ; DUMP-NEXT: constType: 0
497 ; DUMP-NEXT: isConstructorVirtualBase: 0
498 ; DUMP-NEXT: isCxxReturnUdt: 0
499 ; DUMP-NEXT: unalignedType: 0
500 ; DUMP-NEXT: volatileType: 0
501 ; DUMP-NEXT: }
502 ; DUMP-NEXT: {
503 ; DUMP-NEXT: symIndexId: 41
504 ; DUMP-NEXT: symTag: FunctionSig
505 ; DUMP-NEXT: callingConvention: __thiscall
506 ; DUMP-NEXT: count: 2
507 ; DUMP-NEXT: typeId: 3
508 ; DUMP-NEXT: thisAdjust: 0
509 ; DUMP-NEXT: constructor: 1
510 ; DUMP-NEXT: constType: 0
511 ; DUMP-NEXT: isConstructorVirtualBase: 0
512 ; DUMP-NEXT: isCxxReturnUdt: 0
513 ; DUMP-NEXT: unalignedType: 0
514 ; DUMP-NEXT: volatileType: 0
515 ; DUMP-NEXT: }
516 ; DUMP-NEXT: {
517 ; DUMP-NEXT: symIndexId: 43
518 ; DUMP-NEXT: symTag: FunctionSig
519 ; DUMP-NEXT: callingConvention: __thiscall
520 ; DUMP-NEXT: count: 2
521 ; DUMP-NEXT: typeId: 3
522 ; DUMP-NEXT: thisAdjust: 0
523 ; DUMP-NEXT: constructor: 1
524 ; DUMP-NEXT: constType: 0
525 ; DUMP-NEXT: isConstructorVirtualBase: 0
526 ; DUMP-NEXT: isCxxReturnUdt: 0
527 ; DUMP-NEXT: unalignedType: 0
528 ; DUMP-NEXT: volatileType: 0
529 ; DUMP-NEXT: }
530 ; DUMP-NEXT: {
531 ; DUMP-NEXT: symIndexId: 45
532 ; DUMP-NEXT: symTag: FunctionSig
533 ; DUMP-NEXT: callingConvention: __thiscall
534 ; DUMP-NEXT: count: 2
535 ; DUMP-NEXT: typeId: 3
536 ; DUMP-NEXT: thisAdjust: 0
537 ; DUMP-NEXT: constructor: 1
538 ; DUMP-NEXT: constType: 0
539 ; DUMP-NEXT: isConstructorVirtualBase: 0
540 ; DUMP-NEXT: isCxxReturnUdt: 0
541 ; DUMP-NEXT: unalignedType: 0
542 ; DUMP-NEXT: volatileType: 0
543 ; DUMP-NEXT: }
544 ; DUMP-NEXT: {
545 ; DUMP-NEXT: symIndexId: 47
546 ; DUMP-NEXT: symTag: FunctionSig
547 ; DUMP-NEXT: callingConvention: __thiscall
548 ; DUMP-NEXT: count: 1
549 ; DUMP-NEXT: typeId: 3
550 ; DUMP-NEXT: thisAdjust: 0
551 ; DUMP-NEXT: constructor: 1
552 ; DUMP-NEXT: constType: 0
553 ; DUMP-NEXT: isConstructorVirtualBase: 0
554 ; DUMP-NEXT: isCxxReturnUdt: 0
555 ; DUMP-NEXT: unalignedType: 0
556 ; DUMP-NEXT: volatileType: 0
557 ; DUMP-NEXT: }
558 ; DUMP-NEXT: {
559 ; DUMP-NEXT: symIndexId: 48
560 ; DUMP-NEXT: symTag: FunctionSig
561 ; DUMP-NEXT: callingConvention: __thiscall
562 ; DUMP-NEXT: count: 2
563 ; DUMP-NEXT: typeId: 3
564 ; DUMP-NEXT: thisAdjust: 0
565 ; DUMP-NEXT: constructor: 1
566 ; DUMP-NEXT: constType: 0
567 ; DUMP-NEXT: isConstructorVirtualBase: 0
568 ; DUMP-NEXT: isCxxReturnUdt: 0
569 ; DUMP-NEXT: unalignedType: 0
570 ; DUMP-NEXT: volatileType: 0
571 ; DUMP-NEXT: }
572 ; DUMP-NEXT: {
573 ; DUMP-NEXT: symIndexId: 50
574 ; DUMP-NEXT: symTag: FunctionSig
575 ; DUMP-NEXT: callingConvention: __thiscall
576 ; DUMP-NEXT: count: 1
577 ; DUMP-NEXT: typeId: 3
578 ; DUMP-NEXT: thisAdjust: 0
579 ; DUMP-NEXT: constructor: 1
580 ; DUMP-NEXT: constType: 0
581 ; DUMP-NEXT: isConstructorVirtualBase: 0
582 ; DUMP-NEXT: isCxxReturnUdt: 0
583 ; DUMP-NEXT: unalignedType: 0
584 ; DUMP-NEXT: volatileType: 0
585 ; DUMP-NEXT: }
586 ; DUMP-NEXT: {
587 ; DUMP-NEXT: symIndexId: 51
588 ; DUMP-NEXT: symTag: FunctionSig
589 ; DUMP-NEXT: callingConvention: __thiscall
590 ; DUMP-NEXT: count: 3
591 ; DUMP-NEXT: typeId: 3
592 ; DUMP-NEXT: thisAdjust: 0
593 ; DUMP-NEXT: constructor: 1
594 ; DUMP-NEXT: constType: 0
595 ; DUMP-NEXT: isConstructorVirtualBase: 0
596 ; DUMP-NEXT: isCxxReturnUdt: 0
597 ; DUMP-NEXT: unalignedType: 0
598 ; DUMP-NEXT: volatileType: 0
599 ; DUMP-NEXT: }
600 ; DUMP-NEXT: {
601 ; DUMP-NEXT: symIndexId: 53
602 ; DUMP-NEXT: symTag: FunctionSig
603 ; DUMP-NEXT: callingConvention: __thiscall
604 ; DUMP-NEXT: count: 2
605 ; DUMP-NEXT: typeId: 3
606 ; DUMP-NEXT: thisAdjust: 0
607 ; DUMP-NEXT: constructor: 1
608 ; DUMP-NEXT: constType: 0
609 ; DUMP-NEXT: isConstructorVirtualBase: 0
610 ; DUMP-NEXT: isCxxReturnUdt: 0
611 ; DUMP-NEXT: unalignedType: 0
612 ; DUMP-NEXT: volatileType: 0
613 ; DUMP-NEXT: }
614 ; DUMP-NEXT: {
615 ; DUMP-NEXT: symIndexId: 54
616 ; DUMP-NEXT: symTag: FunctionSig
617 ; DUMP-NEXT: callingConvention: __thiscall
618 ; DUMP-NEXT: count: 1
619 ; DUMP-NEXT: typeId: 3
620 ; DUMP-NEXT: thisAdjust: 0
621 ; DUMP-NEXT: constructor: 1
622 ; DUMP-NEXT: constType: 0
623 ; DUMP-NEXT: isConstructorVirtualBase: 0
624 ; DUMP-NEXT: isCxxReturnUdt: 0
625 ; DUMP-NEXT: unalignedType: 0
626 ; DUMP-NEXT: volatileType: 0
627 ; DUMP-NEXT: }
628 ; DUMP-NEXT: {
629 ; DUMP-NEXT: symIndexId: 55
630 ; DUMP-NEXT: symTag: FunctionSig
631 ; DUMP-NEXT: callingConvention: __thiscall
632 ; DUMP-NEXT: count: 16
633 ; DUMP-NEXT: typeId: 3
634 ; DUMP-NEXT: thisAdjust: 0
635 ; DUMP-NEXT: constructor: 1
636 ; DUMP-NEXT: constType: 0
637 ; DUMP-NEXT: isConstructorVirtualBase: 0
638 ; DUMP-NEXT: isCxxReturnUdt: 0
639 ; DUMP-NEXT: unalignedType: 0
640 ; DUMP-NEXT: volatileType: 0
641 ; DUMP-NEXT: }
642 ; DUMP-NEXT: {
643 ; DUMP-NEXT: symIndexId: 57
644 ; DUMP-NEXT: symTag: FunctionSig
645 ; DUMP-NEXT: callingConvention: __thiscall
646 ; DUMP-NEXT: count: 2
647 ; DUMP-NEXT: typeId: 3
648 ; DUMP-NEXT: thisAdjust: 0
649 ; DUMP-NEXT: constructor: 1
650 ; DUMP-NEXT: constType: 0
651 ; DUMP-NEXT: isConstructorVirtualBase: 0
652 ; DUMP-NEXT: isCxxReturnUdt: 0
653 ; DUMP-NEXT: unalignedType: 0
654 ; DUMP-NEXT: volatileType: 0
655 ; DUMP-NEXT: }
656 ; DUMP-NEXT: {
657 ; DUMP-NEXT: symIndexId: 58
658 ; DUMP-NEXT: symTag: FunctionSig
659 ; DUMP-NEXT: callingConvention: __thiscall
660 ; DUMP-NEXT: count: 1
661 ; DUMP-NEXT: typeId: 3
662 ; DUMP-NEXT: thisAdjust: 0
663 ; DUMP-NEXT: constructor: 1
664 ; DUMP-NEXT: constType: 0
665 ; DUMP-NEXT: isConstructorVirtualBase: 0
666 ; DUMP-NEXT: isCxxReturnUdt: 0
667 ; DUMP-NEXT: unalignedType: 0
668 ; DUMP-NEXT: volatileType: 0
669 ; DUMP-NEXT: }
670 ; DUMP-NEXT: {
671 ; DUMP-NEXT: symIndexId: 59
672 ; DUMP-NEXT: symTag: FunctionSig
673 ; DUMP-NEXT: callingConvention: __thiscall
674 ; DUMP-NEXT: count: 1
675 ; DUMP-NEXT: typeId: 3
676 ; DUMP-NEXT: thisAdjust: 0
677 ; DUMP-NEXT: constructor: 0
678 ; DUMP-NEXT: constType: 0
679 ; DUMP-NEXT: isConstructorVirtualBase: 0
680 ; DUMP-NEXT: isCxxReturnUdt: 0
681 ; DUMP-NEXT: unalignedType: 0
682 ; DUMP-NEXT: volatileType: 0
683 ; DUMP-NEXT: }
684 ; DUMP-NEXT: {
685 ; DUMP-NEXT: symIndexId: 61
686 ; DUMP-NEXT: symTag: FunctionSig
687 ; DUMP-NEXT: callingConvention: __thiscall
688 ; DUMP-NEXT: count: 2
689 ; DUMP-NEXT: typeId: 3
690 ; DUMP-NEXT: thisAdjust: 0
691 ; DUMP-NEXT: constructor: 1
692 ; DUMP-NEXT: constType: 0
693 ; DUMP-NEXT: isConstructorVirtualBase: 0
694 ; DUMP-NEXT: isCxxReturnUdt: 0
695 ; DUMP-NEXT: unalignedType: 0
696 ; DUMP-NEXT: volatileType: 0
697 ; DUMP-NEXT: }
698 ; DUMP-NEXT: {
699 ; DUMP-NEXT: symIndexId: 62
700 ; DUMP-NEXT: symTag: FunctionSig
701 ; DUMP-NEXT: callingConvention: __thiscall
702 ; DUMP-NEXT: count: 1
703 ; DUMP-NEXT: typeId: 3
704 ; DUMP-NEXT: thisAdjust: 0
705 ; DUMP-NEXT: constructor: 1
706 ; DUMP-NEXT: constType: 0
707 ; DUMP-NEXT: isConstructorVirtualBase: 0
708 ; DUMP-NEXT: isCxxReturnUdt: 0
709 ; DUMP-NEXT: unalignedType: 0
710 ; DUMP-NEXT: volatileType: 0
711 ; DUMP-NEXT: }
712 ; DUMP-NEXT: {
713 ; DUMP-NEXT: symIndexId: 63
714 ; DUMP-NEXT: symTag: FunctionSig
715 ; DUMP-NEXT: callingConvention: __thiscall
716 ; DUMP-NEXT: count: 2
717 ; DUMP-NEXT: typeId: 64
718 ; DUMP-NEXT: thisAdjust: 0
719 ; DUMP-NEXT: constructor: 0
720 ; DUMP-NEXT: constType: 0
721 ; DUMP-NEXT: isConstructorVirtualBase: 0
722 ; DUMP-NEXT: isCxxReturnUdt: 0
723 ; DUMP-NEXT: unalignedType: 0
724 ; DUMP-NEXT: volatileType: 0
725 ; DUMP-NEXT: }
726 ; DUMP-NEXT: {
727 ; DUMP-NEXT: symIndexId: 65
728 ; DUMP-NEXT: symTag: FunctionSig
729 ; DUMP-NEXT: callingConvention: __thiscall
730 ; DUMP-NEXT: count: 2
731 ; DUMP-NEXT: typeId: 37
732 ; DUMP-NEXT: thisAdjust: 0
733 ; DUMP-NEXT: constructor: 0
734 ; DUMP-NEXT: constType: 0
735 ; DUMP-NEXT: isConstructorVirtualBase: 0
736 ; DUMP-NEXT: isCxxReturnUdt: 0
737 ; DUMP-NEXT: unalignedType: 0
738 ; DUMP-NEXT: volatileType: 0
739 ; DUMP-NEXT: }
740 ; DUMP-NEXT: {
741 ; DUMP-NEXT: symIndexId: 66
742 ; DUMP-NEXT: symTag: FunctionSig
743 ; DUMP-NEXT: callingConvention: __thiscall
744 ; DUMP-NEXT: count: 2
745 ; DUMP-NEXT: typeId: 3
746 ; DUMP-NEXT: thisAdjust: 0
747 ; DUMP-NEXT: constructor: 1
748 ; DUMP-NEXT: constType: 0
749 ; DUMP-NEXT: isConstructorVirtualBase: 1
750 ; DUMP-NEXT: isCxxReturnUdt: 0
751 ; DUMP-NEXT: unalignedType: 0
752 ; DUMP-NEXT: volatileType: 0
753 ; DUMP-NEXT: }
754 ; DUMP-NEXT: {
755 ; DUMP-NEXT: symIndexId: 68
756 ; DUMP-NEXT: symTag: FunctionSig
757 ; DUMP-NEXT: callingConvention: __thiscall
758 ; DUMP-NEXT: count: 2
759 ; DUMP-NEXT: typeId: 3
760 ; DUMP-NEXT: thisAdjust: 0
761 ; DUMP-NEXT: constructor: 1
762 ; DUMP-NEXT: constType: 0
763 ; DUMP-NEXT: isConstructorVirtualBase: 1
764 ; DUMP-NEXT: isCxxReturnUdt: 0
765 ; DUMP-NEXT: unalignedType: 0
766 ; DUMP-NEXT: volatileType: 0
767 ; DUMP-NEXT: }
768 ; DUMP-NEXT: {
769 ; DUMP-NEXT: symIndexId: 69
770 ; DUMP-NEXT: symTag: FunctionSig
771 ; DUMP-NEXT: callingConvention: __thiscall
772 ; DUMP-NEXT: count: 1
773 ; DUMP-NEXT: typeId: 3
774 ; DUMP-NEXT: thisAdjust: 0
775 ; DUMP-NEXT: constructor: 1
776 ; DUMP-NEXT: constType: 0
777 ; DUMP-NEXT: isConstructorVirtualBase: 1
778 ; DUMP-NEXT: isCxxReturnUdt: 0
779 ; DUMP-NEXT: unalignedType: 0
780 ; DUMP-NEXT: volatileType: 0
781 ; DUMP-NEXT: }
782 ; DUMP-NEXT: {
783 ; DUMP-NEXT: symIndexId: 70
784 ; DUMP-NEXT: symTag: FunctionSig
785 ; DUMP-NEXT: callingConvention: __thiscall
786 ; DUMP-NEXT: count: 1
787 ; DUMP-NEXT: typeId: 3
788 ; DUMP-NEXT: thisAdjust: 4
789 ; DUMP-NEXT: constructor: 0
790 ; DUMP-NEXT: constType: 0
791 ; DUMP-NEXT: isConstructorVirtualBase: 0
792 ; DUMP-NEXT: isCxxReturnUdt: 0
793 ; DUMP-NEXT: unalignedType: 0
794 ; DUMP-NEXT: volatileType: 0
795 ; DUMP-NEXT: }
796 ; DUMP-NEXT: {
797 ; DUMP-NEXT: symIndexId: 71
798 ; DUMP-NEXT: symTag: FunctionSig
799 ; DUMP-NEXT: callingConvention: __thiscall
800 ; DUMP-NEXT: count: 2
801 ; DUMP-NEXT: typeId: 72
802 ; DUMP-NEXT: thisAdjust: 0
803 ; DUMP-NEXT: constructor: 0
804 ; DUMP-NEXT: constType: 0
805 ; DUMP-NEXT: isConstructorVirtualBase: 0
806 ; DUMP-NEXT: isCxxReturnUdt: 0
807 ; DUMP-NEXT: unalignedType: 0
808 ; DUMP-NEXT: volatileType: 0
809 ; DUMP-NEXT: }
810 ; DUMP-NEXT: {
811 ; DUMP-NEXT: symIndexId: 73
812 ; DUMP-NEXT: symTag: FunctionSig
813 ; DUMP-NEXT: callingConvention: __thiscall
814 ; DUMP-NEXT: count: 2
815 ; DUMP-NEXT: typeId: 72
816 ; DUMP-NEXT: thisAdjust: 0
817 ; DUMP-NEXT: constructor: 0
818 ; DUMP-NEXT: constType: 0
819 ; DUMP-NEXT: isConstructorVirtualBase: 0
820 ; DUMP-NEXT: isCxxReturnUdt: 0
821 ; DUMP-NEXT: unalignedType: 0
822 ; DUMP-NEXT: volatileType: 0
823 ; DUMP-NEXT: }
824 ; DUMP-NEXT: {
825 ; DUMP-NEXT: symIndexId: 74
826 ; DUMP-NEXT: symTag: FunctionSig
827 ; DUMP-NEXT: callingConvention: __thiscall
828 ; DUMP-NEXT: count: 1
829 ; DUMP-NEXT: typeId: 3
830 ; DUMP-NEXT: thisAdjust: 0
831 ; DUMP-NEXT: constructor: 0
832 ; DUMP-NEXT: constType: 0
833 ; DUMP-NEXT: isConstructorVirtualBase: 0
834 ; DUMP-NEXT: isCxxReturnUdt: 0
835 ; DUMP-NEXT: unalignedType: 0
836 ; DUMP-NEXT: volatileType: 0
837 ; DUMP-NEXT: }
838 ; DUMP-NEXT: {
839 ; DUMP-NEXT: symIndexId: 75
840 ; DUMP-NEXT: symTag: FunctionSig
841 ; DUMP-NEXT: callingConvention: __thiscall
842 ; DUMP-NEXT: count: 2
843 ; DUMP-NEXT: typeId: 37
844 ; DUMP-NEXT: thisAdjust: 4
845 ; DUMP-NEXT: constructor: 0
846 ; DUMP-NEXT: constType: 0
847 ; DUMP-NEXT: isConstructorVirtualBase: 0
848 ; DUMP-NEXT: isCxxReturnUdt: 0
849 ; DUMP-NEXT: unalignedType: 0
850 ; DUMP-NEXT: volatileType: 0
851 ; DUMP-NEXT: }
852 ; DUMP-NEXT: {
853 ; DUMP-NEXT: symIndexId: 76
854 ; DUMP-NEXT: symTag: FunctionSig
855 ; DUMP-NEXT: callingConvention: __cdecl
856 ; DUMP-NEXT: count: 0
857 ; DUMP-NEXT: typeId: 3
858 ; DUMP-NEXT: constructor: 0
859 ; DUMP-NEXT: constType: 0
860 ; DUMP-NEXT: isConstructorVirtualBase: 0
861 ; DUMP-NEXT: isCxxReturnUdt: 0
862 ; DUMP-NEXT: unalignedType: 0
863 ; DUMP-NEXT: volatileType: 0
864 ; DUMP-NEXT: }
1212 #include "PrettyBuiltinDumper.h"
1313 #include "PrettyClassDefinitionDumper.h"
1414 #include "PrettyEnumDumper.h"
15 #include "PrettyFunctionDumper.h"
1516 #include "PrettyTypedefDumper.h"
1617 #include "llvm-pdbutil.h"
1718
1920 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
2021 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
2122 #include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
23 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
2224 #include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
2325 #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
2426 #include "llvm/DebugInfo/PDB/UDTLayout.h"
146148 }
147149 }
148150
151 if (opts::pretty::Funcsigs) {
152 if (auto Funcsigs = Exe.findAllChildren()) {
153 Printer.NewLine();
154 WithColor(Printer, PDB_ColorItem::Identifier).get()
155 << "Function Signatures";
156 Printer << ": (" << Funcsigs->getChildCount() << " items)";
157 Printer.Indent();
158 while (auto FS = Funcsigs->getNext())
159 FS->dump(*this);
160 Printer.Unindent();
161 }
162 }
163
149164 if (opts::pretty::Typedefs) {
150165 if (auto Typedefs = Exe.findAllChildren()) {
151166 Printer.NewLine();
250265 Dumper.start(Symbol);
251266 }
252267
268 void TypeDumper::dump(const PDBSymbolTypeFunctionSig &Symbol) {
269 Printer.NewLine();
270 FunctionDumper Dumper(Printer);
271 Dumper.start(Symbol, nullptr, FunctionDumper::PointerType::None);
272 }
273
253274 void TypeDumper::dumpClassLayout(const ClassLayout &Class) {
254275 assert(opts::pretty::Classes);
255276
2424
2525 void dump(const PDBSymbolTypeEnum &Symbol) override;
2626 void dump(const PDBSymbolTypeTypedef &Symbol) override;
27 void dump(const PDBSymbolTypeFunctionSig &Symbol) override;
2728
2829 void dumpClassLayout(const ClassLayout &Class);
2930
6969 #include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
7070 #include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
7171 #include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
72 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
73 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
7274 #include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
7375 #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
7476 #include "llvm/Support/BinaryByteStream.h"
187189 static cl::opt Compilands("compilands",
188190 cl::desc("Dump compiland information"),
189191 cl::sub(DiaDumpSubcommand));
192 static cl::opt Funcsigs("funcsigs",
193 cl::desc("Dump function signature information"),
194 cl::sub(DiaDumpSubcommand));
190195 } // namespace diadump
191196
192197 namespace pretty {
234239 cl::opt Enums("enums", cl::desc("Display enum types"),
235240 cl::cat(TypeCategory), cl::sub(PrettySubcommand));
236241 cl::opt Typedefs("typedefs", cl::desc("Display typedef types"),
242 cl::cat(TypeCategory), cl::sub(PrettySubcommand));
243 cl::opt Funcsigs("funcsigs", cl::desc("Display function signatures"),
237244 cl::cat(TypeCategory), cl::sub(PrettySubcommand));
238245 cl::opt SymbolOrder(
239246 "symbol-order", cl::desc("symbol sort order"),
968975 }
969976 }
970977
978 template
979 void diaDumpChildren(PDBSymbol &Outer, PdbSymbolIdField Ids,
980 PdbSymbolIdField Recurse) {
981 OuterT *ConcreteOuter = dyn_cast(&Outer);
982 if (!ConcreteOuter)
983 return;
984
985 auto Children = ConcreteOuter->template findAllChildren();
986 while (auto Child = Children->getNext()) {
987 outs() << " {";
988 Child->defaultDump(outs(), 4, Ids, Recurse);
989 outs() << "\n }\n";
990 }
991 }
992
971993 static void dumpDia(StringRef Path) {
972994 std::unique_ptr Session;
973995
9871009 SymTypes.push_back(PDB_SymType::PointerType);
9881010 if (opts::diadump::UDTs)
9891011 SymTypes.push_back(PDB_SymType::UDT);
1012 if (opts::diadump::Funcsigs)
1013 SymTypes.push_back(PDB_SymType::FunctionSig);
9901014
9911015 PdbSymbolIdField Ids = opts::diadump::NoSymIndexIds ? PdbSymbolIdField::None
9921016 : PdbSymbolIdField::All;
10011025 while (auto Child = Children->getNext()) {
10021026 outs() << "{";
10031027 Child->defaultDump(outs(), 2, Ids, Recurse);
1004 if (auto Enum = dyn_cast(Child.get())) {
1005 auto Enumerators = Enum->findAllChildren();
1006 while (auto Enumerator = Enumerators->getNext()) {
1007 outs() << " {";
1008 Enumerator->defaultDump(outs(), 4, Ids, Recurse);
1009 outs() << "\n }\n";
1010 }
1011 }
1028
1029 diaDumpChildren(*Child, Ids, Recurse);
10121030 outs() << "\n}\n";
10131031 }
10141032 }
1015 auto Child = Session->getSymbolById(3);
1016 Child->defaultDump(outs(), 2, PdbSymbolIdField::All, PdbSymbolIdField::None);
10171033 }
10181034
10191035 static void dumpPretty(StringRef Path) {
11611177 }
11621178 }
11631179
1164 if (opts::pretty::Classes || opts::pretty::Enums || opts::pretty::Typedefs) {
1180 if (opts::pretty::Classes || opts::pretty::Enums || opts::pretty::Typedefs ||
1181 opts::pretty::Funcsigs) {
11651182 Printer.NewLine();
11661183 WithColor(Printer, PDB_ColorItem::SectionHeader).get() << "---TYPES---";
11671184 Printer.Indent();
8181 extern llvm::cl::opt Globals;
8282 extern llvm::cl::opt Classes;
8383 extern llvm::cl::opt Enums;
84 extern llvm::cl::opt Funcsigs;
8485 extern llvm::cl::opt Typedefs;
8586 extern llvm::cl::opt All;
8687 extern llvm::cl::opt ExcludeCompilerGenerated;