[lit] Remove LitTestCase
[llvm-complete.git] / tools / llvm-pdbutil / llvm-pdbutil.h
bloba54bfcdb72226455044b0c8158a25a032c28eef8
1 //===- llvm-pdbutil.h ----------------------------------------- *- C++ --*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
12 #include "llvm/ADT/DenseMap.h"
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/PointerUnion.h"
15 #include "llvm/Support/CommandLine.h"
16 #include "llvm/Support/raw_ostream.h"
18 #include <memory>
19 #include <stdint.h>
21 namespace llvm {
22 namespace object {
23 class COFFObjectFile;
25 namespace pdb {
26 class PDBSymbolData;
27 class PDBSymbolFunc;
28 class PDBFile;
29 uint32_t getTypeLength(const PDBSymbolData &Symbol);
31 typedef llvm::PointerUnion<object::COFFObjectFile *, pdb::PDBFile *>
32 PdbOrCoffObj;
35 namespace opts {
37 enum class DumpLevel { None, Basic, Verbose };
39 enum class ModuleSubsection {
40 Unknown,
41 Lines,
42 FileChecksums,
43 InlineeLines,
44 CrossScopeImports,
45 CrossScopeExports,
46 StringTable,
47 Symbols,
48 FrameData,
49 CoffSymbolRVAs,
50 All
53 namespace pretty {
55 enum class ClassDefinitionFormat { None, Layout, All };
56 enum class ClassSortMode {
57 None,
58 Name,
59 Size,
60 Padding,
61 PaddingPct,
62 PaddingImmediate,
63 PaddingPctImmediate
66 enum class SymbolSortMode { None, Name, Size };
68 enum class SymLevel { Functions, Data, Thunks, All };
70 bool shouldDumpSymLevel(SymLevel Level);
71 bool compareFunctionSymbols(
72 const std::unique_ptr<llvm::pdb::PDBSymbolFunc> &F1,
73 const std::unique_ptr<llvm::pdb::PDBSymbolFunc> &F2);
74 bool compareDataSymbols(const std::unique_ptr<llvm::pdb::PDBSymbolData> &F1,
75 const std::unique_ptr<llvm::pdb::PDBSymbolData> &F2);
77 extern llvm::cl::list<std::string> WithName;
79 extern llvm::cl::opt<bool> Compilands;
80 extern llvm::cl::opt<bool> Symbols;
81 extern llvm::cl::opt<bool> Globals;
82 extern llvm::cl::opt<bool> Classes;
83 extern llvm::cl::opt<bool> Enums;
84 extern llvm::cl::opt<bool> Funcsigs;
85 extern llvm::cl::opt<bool> Arrays;
86 extern llvm::cl::opt<bool> Typedefs;
87 extern llvm::cl::opt<bool> Pointers;
88 extern llvm::cl::opt<bool> VTShapes;
89 extern llvm::cl::opt<bool> All;
90 extern llvm::cl::opt<bool> ExcludeCompilerGenerated;
92 extern llvm::cl::opt<bool> NoEnumDefs;
93 extern llvm::cl::list<std::string> ExcludeTypes;
94 extern llvm::cl::list<std::string> ExcludeSymbols;
95 extern llvm::cl::list<std::string> ExcludeCompilands;
96 extern llvm::cl::list<std::string> IncludeTypes;
97 extern llvm::cl::list<std::string> IncludeSymbols;
98 extern llvm::cl::list<std::string> IncludeCompilands;
99 extern llvm::cl::opt<SymbolSortMode> SymbolOrder;
100 extern llvm::cl::opt<ClassSortMode> ClassOrder;
101 extern llvm::cl::opt<uint32_t> SizeThreshold;
102 extern llvm::cl::opt<uint32_t> PaddingThreshold;
103 extern llvm::cl::opt<uint32_t> ImmediatePaddingThreshold;
104 extern llvm::cl::opt<ClassDefinitionFormat> ClassFormat;
105 extern llvm::cl::opt<uint32_t> ClassRecursionDepth;
108 namespace bytes {
109 struct NumberRange {
110 uint64_t Min;
111 llvm::Optional<uint64_t> Max;
114 extern llvm::Optional<NumberRange> DumpBlockRange;
115 extern llvm::Optional<NumberRange> DumpByteRange;
116 extern llvm::cl::list<std::string> DumpStreamData;
117 extern llvm::cl::opt<bool> NameMap;
118 extern llvm::cl::opt<bool> Fpm;
120 extern llvm::cl::opt<bool> SectionContributions;
121 extern llvm::cl::opt<bool> SectionMap;
122 extern llvm::cl::opt<bool> ModuleInfos;
123 extern llvm::cl::opt<bool> FileInfo;
124 extern llvm::cl::opt<bool> TypeServerMap;
125 extern llvm::cl::opt<bool> ECData;
127 extern llvm::cl::list<uint32_t> TypeIndex;
128 extern llvm::cl::list<uint32_t> IdIndex;
130 extern llvm::cl::opt<uint32_t> ModuleIndex;
131 extern llvm::cl::opt<bool> ModuleSyms;
132 extern llvm::cl::opt<bool> ModuleC11;
133 extern llvm::cl::opt<bool> ModuleC13;
134 extern llvm::cl::opt<bool> SplitChunks;
135 } // namespace bytes
137 namespace dump {
139 extern llvm::cl::opt<bool> DumpSummary;
140 extern llvm::cl::opt<bool> DumpFpm;
141 extern llvm::cl::opt<bool> DumpStreams;
142 extern llvm::cl::opt<bool> DumpSymbolStats;
143 extern llvm::cl::opt<bool> DumpUdtStats;
144 extern llvm::cl::opt<bool> DumpStreamBlocks;
146 extern llvm::cl::opt<bool> DumpLines;
147 extern llvm::cl::opt<bool> DumpInlineeLines;
148 extern llvm::cl::opt<bool> DumpXmi;
149 extern llvm::cl::opt<bool> DumpXme;
150 extern llvm::cl::opt<bool> DumpNamedStreams;
151 extern llvm::cl::opt<bool> DumpStringTable;
152 extern llvm::cl::opt<bool> DumpStringTableDetails;
153 extern llvm::cl::opt<bool> DumpTypes;
154 extern llvm::cl::opt<bool> DumpTypeData;
155 extern llvm::cl::opt<bool> DumpTypeExtras;
156 extern llvm::cl::list<uint32_t> DumpTypeIndex;
157 extern llvm::cl::opt<bool> DumpTypeDependents;
158 extern llvm::cl::opt<bool> DumpSectionHeaders;
160 extern llvm::cl::opt<bool> DumpIds;
161 extern llvm::cl::opt<bool> DumpIdData;
162 extern llvm::cl::opt<bool> DumpIdExtras;
163 extern llvm::cl::list<uint32_t> DumpIdIndex;
164 extern llvm::cl::opt<uint32_t> DumpModi;
165 extern llvm::cl::opt<bool> JustMyCode;
166 extern llvm::cl::opt<bool> DontResolveForwardRefs;
167 extern llvm::cl::opt<bool> DumpSymbols;
168 extern llvm::cl::opt<bool> DumpSymRecordBytes;
169 extern llvm::cl::opt<bool> DumpGSIRecords;
170 extern llvm::cl::opt<bool> DumpGlobals;
171 extern llvm::cl::list<std::string> DumpGlobalNames;
172 extern llvm::cl::opt<bool> DumpGlobalExtras;
173 extern llvm::cl::opt<bool> DumpPublics;
174 extern llvm::cl::opt<bool> DumpPublicExtras;
175 extern llvm::cl::opt<bool> DumpSectionContribs;
176 extern llvm::cl::opt<bool> DumpSectionMap;
177 extern llvm::cl::opt<bool> DumpModules;
178 extern llvm::cl::opt<bool> DumpModuleFiles;
179 extern llvm::cl::opt<bool> DumpFpo;
180 extern llvm::cl::opt<bool> RawAll;
183 namespace pdb2yaml {
184 extern llvm::cl::opt<bool> All;
185 extern llvm::cl::opt<bool> NoFileHeaders;
186 extern llvm::cl::opt<bool> Minimal;
187 extern llvm::cl::opt<bool> StreamMetadata;
188 extern llvm::cl::opt<bool> StreamDirectory;
189 extern llvm::cl::opt<bool> StringTable;
190 extern llvm::cl::opt<bool> PdbStream;
191 extern llvm::cl::opt<bool> DbiStream;
192 extern llvm::cl::opt<bool> TpiStream;
193 extern llvm::cl::opt<bool> IpiStream;
194 extern llvm::cl::opt<bool> PublicsStream;
195 extern llvm::cl::list<std::string> InputFilename;
196 extern llvm::cl::opt<bool> DumpModules;
197 extern llvm::cl::opt<bool> DumpModuleFiles;
198 extern llvm::cl::list<ModuleSubsection> DumpModuleSubsections;
199 extern llvm::cl::opt<bool> DumpModuleSyms;
200 } // namespace pdb2yaml
202 namespace explain {
203 enum class InputFileType { PDBFile, PDBStream, DBIStream, Names, ModuleStream };
205 extern llvm::cl::list<std::string> InputFilename;
206 extern llvm::cl::list<uint64_t> Offsets;
207 extern llvm::cl::opt<InputFileType> InputType;
208 } // namespace explain
210 namespace exportstream {
211 extern llvm::cl::opt<std::string> OutputFile;
212 extern llvm::cl::opt<std::string> Stream;
213 extern llvm::cl::opt<bool> ForceName;
214 } // namespace exportstream
217 #endif