LLVM: lib/DebugInfo/PDB/PDBSymbol.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

47#include

48

49using namespace llvm;

51

53

55 : Session(Other.Session), RawSymbol(std::move(Other.RawSymbol)) {}

56

58

59#define FACTORY_SYMTAG_CASE(Tag, Type) \

60 case PDB_SymType::Tag: \

61 return std::unique_ptr(new Type(PDBSession));

62

63std::unique_ptr

65 switch (Tag) {

96 default:

97 return std::unique_ptr(new PDBSymbolUnknown(PDBSession));

98 }

99}

100

101std::unique_ptr

103 std::unique_ptr RawSymbol) {

105 SymbolPtr->RawSymbol = RawSymbol.get();

106 SymbolPtr->OwnedRawSymbol = std::move(RawSymbol);

107 return SymbolPtr;

108}

109

113 SymbolPtr->RawSymbol = &RawSymbol;

114 return SymbolPtr;

115}

116

121}

122

124 outs() << "\n";

127}

128

132 outs() << "\n";

133 for (auto &Stat : Stats) {

134 outs() << Stat.first << ": " << Stat.second << "\n";

135 }

137}

138

141

144}

145

146std::unique_ptr

149}

150

151std::unique_ptr

155}

156

157std::unique_ptr

161}

162

163std::unique_ptr

166}

167

168std::unique_ptr

171}

172

173std::unique_ptr

176}

177

178std::unique_ptr

181}

182

184

185std::unique_ptr

187 std::unique_ptr Result(findAllChildren());

188 if (!Result)

189 return nullptr;

191 while (auto Child = Result->getNext()) {

192 ++Stats[Child->getSymTag()];

193 }

194 Result->reset();

195 return Result;

196}

197

200}

201

209 return;

210

211 OS << "\n";

214

216 return;

217

219 return;

220

222

223

224

225 if (!Child)

226 return;

227

228

229

231}

block placement Basic Block Placement Stats

#define FACTORY_SYMTAG_CASE(Tag, Type)

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

LLVM Value Representation.

IPDBRawSymbol defines an interface used to represent an arbitrary symbol.

virtual std::string getName() const =0

virtual void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const =0

virtual PDB_SymType getSymTag() const =0

virtual std::unique_ptr< IPDBEnumSymbols > findInlineFramesByRVA(uint32_t RVA) const =0

virtual std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type) const =0

virtual std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByVA(uint64_t VA, uint32_t Length) const =0

virtual SymIndexId getSymIndexId() const =0

virtual std::unique_ptr< IPDBEnumSymbols > findInlineFramesByVA(uint64_t VA) const =0

virtual std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const =0

virtual std::unique_ptr< IPDBEnumSymbols > findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const =0

IPDBSession defines an interface used to provide a context for querying debug information from a debu...

virtual std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const =0

PDBSymbolCustom represents symbols that are compiler-specific and do not fit anywhere else in the lex...

PDBSymbol defines the base of the inheritance hierarchy for concrete symbol types (e....

uint32_t getSymIndexId() const

PDB_SymType getSymTag() const

void dumpChildStats() const

const IPDBSession & Session

std::unique_ptr< PDBSymbol > getSymbolByIdHelper(uint32_t Id) const

std::unique_ptr< ConcreteSymbolEnumerator< T > > findAllChildren() const

std::unique_ptr< IPDBEnumSymbols > findInlineFramesByVA(uint64_t VA) const

void dumpProperties() const

std::unique_ptr< IPDBEnumSymbols > findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const

std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const

std::unique_ptr< IPDBEnumSymbols > findInlineFramesByRVA(uint32_t RVA) const

std::string getName() const

PDBSymbol(const IPDBSession &PDBSession)

void defaultDump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags) const

std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByVA(uint64_t VA, uint32_t Length) const

IPDBRawSymbol * RawSymbol

std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags) const

static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)

std::unique_ptr< IPDBEnumSymbols > getChildStats(TagStats &Stats) const

This class implements an extremely fast bulk output stream that can only output to a stream.

raw_ostream & indent(unsigned NumSpaces)

indent - Insert 'NumSpaces' spaces.

PDB_NameSearchFlags

Defines flags used for enumerating child symbols.

std::unordered_map< PDB_SymType, int > TagStats

PDB_SymType

These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....

void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)

This is an optimization pass for GlobalISel generic memory operations.

raw_fd_ostream & outs()

This returns a reference to a raw_fd_ostream for standard output.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.