LLVM  7.0.0svn
DIARawSymbol.cpp
Go to the documentation of this file.
1 //===- DIARawSymbol.cpp - DIA implementation of IPDBRawSymbol ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "llvm/ADT/ArrayRef.h"
12 #include "llvm/ADT/STLExtras.h"
24 
25 using namespace llvm;
26 using namespace llvm::pdb;
27 
28 namespace {
29 Variant VariantFromVARIANT(const VARIANT &V) {
30  Variant Result;
31  switch (V.vt) {
32  case VT_I1:
33  Result.Value.Int8 = V.cVal;
34  Result.Type = PDB_VariantType::Int8;
35  break;
36  case VT_I2:
37  Result.Value.Int16 = V.iVal;
39  break;
40  case VT_I4:
41  Result.Value.Int32 = V.intVal;
43  break;
44  case VT_I8:
45  Result.Value.Int64 = V.llVal;
47  break;
48  case VT_UI1:
49  Result.Value.UInt8 = V.bVal;
51  break;
52  case VT_UI2:
53  Result.Value.UInt16 = V.uiVal;
55  break;
56  case VT_UI4:
57  Result.Value.UInt32 = V.uintVal;
59  break;
60  case VT_UI8:
61  Result.Value.UInt64 = V.ullVal;
63  break;
64  case VT_BOOL:
65  Result.Value.Bool = (V.boolVal == VARIANT_TRUE) ? true : false;
66  Result.Type = PDB_VariantType::Bool;
67  break;
68  case VT_R4:
69  Result.Value.Single = V.fltVal;
71  break;
72  case VT_R8:
73  Result.Value.Double = V.dblVal;
75  break;
76  case VT_BSTR: {
77  const char *SrcBytes = reinterpret_cast<const char *>(V.bstrVal);
78  llvm::ArrayRef<char> SrcByteArray(SrcBytes, SysStringByteLen(V.bstrVal));
79  std::string Result8;
80  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
81  Result.Value.String = nullptr;
82  Result.Value.String = new char[Result8.length() + 1];
83  ::strcpy(Result.Value.String, Result8.c_str());
85  break;
86  }
87  default:
89  break;
90  }
91  return Result;
92 }
93 
94 template <typename ArgType>
95 ArgType PrivateGetDIAValue(IDiaSymbol *Symbol,
96  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
97  ArgType Value;
98  if (S_OK == (Symbol->*Method)(&Value))
99  return static_cast<ArgType>(Value);
100 
101  return ArgType();
102 }
103 
104 template <typename ArgType, typename RetType>
105 RetType PrivateGetDIAValue(IDiaSymbol *Symbol,
106  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
107  ArgType Value;
108  if (S_OK == (Symbol->*Method)(&Value))
109  return static_cast<RetType>(Value);
110 
111  return RetType();
112 }
113 
114 std::string
115 PrivateGetDIAValue(IDiaSymbol *Symbol,
116  HRESULT (__stdcall IDiaSymbol::*Method)(BSTR *)) {
117  CComBSTR Result16;
118  if (S_OK != (Symbol->*Method)(&Result16))
119  return std::string();
120 
121  const char *SrcBytes = reinterpret_cast<const char *>(Result16.m_str);
122  llvm::ArrayRef<char> SrcByteArray(SrcBytes, Result16.ByteLength());
123  std::string Result8;
124  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
125  return std::string();
126  return Result8;
127 }
128 
130 PrivateGetDIAValue(IDiaSymbol *Symbol,
131  HRESULT (__stdcall IDiaSymbol::*Method)(GUID *)) {
132  GUID Result;
133  if (S_OK != (Symbol->*Method)(&Result))
134  return codeview::GUID();
135 
136  static_assert(sizeof(codeview::GUID) == sizeof(GUID),
137  "GUID is the wrong size!");
138  codeview::GUID IdResult;
139  ::memcpy(&IdResult, &Result, sizeof(GUID));
140  return IdResult;
141 }
142 
143 template <typename ArgType>
144 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
145  IDiaSymbol *Symbol,
146  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
147  ArgType Value;
148  if (S_OK == (Symbol->*Method)(&Value)) {
149  OS << "\n";
150  OS.indent(Indent);
151  OS << Name << ": " << Value;
152  }
153 }
154 
155 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
156  IDiaSymbol *Symbol,
157  HRESULT (__stdcall IDiaSymbol::*Method)(BSTR *)) {
158  BSTR Value = nullptr;
159  if (S_OK != (Symbol->*Method)(&Value))
160  return;
161  const char *Bytes = reinterpret_cast<const char *>(Value);
162  ArrayRef<char> ByteArray(Bytes, ::SysStringByteLen(Value));
163  std::string Result;
164  if (llvm::convertUTF16ToUTF8String(ByteArray, Result)) {
165  OS << "\n";
166  OS.indent(Indent);
167  OS << Name << ": " << Result;
168  }
169  ::SysFreeString(Value);
170 }
171 
172 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
173  IDiaSymbol *Symbol,
174  HRESULT (__stdcall IDiaSymbol::*Method)(VARIANT *)) {
175  VARIANT Value;
176  Value.vt = VT_EMPTY;
177  if (S_OK != (Symbol->*Method)(&Value))
178  return;
179  OS << "\n";
180  OS.indent(Indent);
181  Variant V = VariantFromVARIANT(Value);
182  OS << V;
183 }
184 }
185 
186 namespace llvm {
188  StringRef GuidBytes(reinterpret_cast<const char *>(&G), sizeof(G));
189  codeview::detail::GuidAdapter A(GuidBytes);
190  A.format(OS, "");
191  return OS;
192 }
193 }
194 
196  CComPtr<IDiaSymbol> DiaSymbol)
197  : Session(PDBSession), Symbol(DiaSymbol) {}
198 
199 #define RAW_METHOD_DUMP(Stream, Method) \
200  DumpDIAValue(Stream, Indent, StringRef(#Method), Symbol, &IDiaSymbol::Method);
201 
202 void DIARawSymbol::dump(raw_ostream &OS, int Indent) const {
203  RAW_METHOD_DUMP(OS, get_access)
204  RAW_METHOD_DUMP(OS, get_addressOffset)
205  RAW_METHOD_DUMP(OS, get_addressSection)
206  RAW_METHOD_DUMP(OS, get_age)
207  RAW_METHOD_DUMP(OS, get_arrayIndexTypeId)
208  RAW_METHOD_DUMP(OS, get_backEndMajor)
209  RAW_METHOD_DUMP(OS, get_backEndMinor)
210  RAW_METHOD_DUMP(OS, get_backEndBuild)
211  RAW_METHOD_DUMP(OS, get_backEndQFE)
212  RAW_METHOD_DUMP(OS, get_baseDataOffset)
213  RAW_METHOD_DUMP(OS, get_baseDataSlot)
214  RAW_METHOD_DUMP(OS, get_baseSymbolId)
215  RAW_METHOD_DUMP(OS, get_baseType)
216  RAW_METHOD_DUMP(OS, get_bitPosition)
217  RAW_METHOD_DUMP(OS, get_callingConvention)
218  RAW_METHOD_DUMP(OS, get_classParentId)
219  RAW_METHOD_DUMP(OS, get_compilerName)
220  RAW_METHOD_DUMP(OS, get_count)
221  RAW_METHOD_DUMP(OS, get_countLiveRanges)
222  RAW_METHOD_DUMP(OS, get_frontEndMajor)
223  RAW_METHOD_DUMP(OS, get_frontEndMinor)
224  RAW_METHOD_DUMP(OS, get_frontEndBuild)
225  RAW_METHOD_DUMP(OS, get_frontEndQFE)
226  RAW_METHOD_DUMP(OS, get_lexicalParentId)
227  RAW_METHOD_DUMP(OS, get_libraryName)
228  RAW_METHOD_DUMP(OS, get_liveRangeStartAddressOffset)
229  RAW_METHOD_DUMP(OS, get_liveRangeStartAddressSection)
230  RAW_METHOD_DUMP(OS, get_liveRangeStartRelativeVirtualAddress)
231  RAW_METHOD_DUMP(OS, get_localBasePointerRegisterId)
232  RAW_METHOD_DUMP(OS, get_lowerBoundId)
233  RAW_METHOD_DUMP(OS, get_memorySpaceKind)
234  RAW_METHOD_DUMP(OS, get_name)
235  RAW_METHOD_DUMP(OS, get_numberOfAcceleratorPointerTags)
236  RAW_METHOD_DUMP(OS, get_numberOfColumns)
237  RAW_METHOD_DUMP(OS, get_numberOfModifiers)
238  RAW_METHOD_DUMP(OS, get_numberOfRegisterIndices)
239  RAW_METHOD_DUMP(OS, get_numberOfRows)
240  RAW_METHOD_DUMP(OS, get_objectFileName)
241  RAW_METHOD_DUMP(OS, get_oemId)
242  RAW_METHOD_DUMP(OS, get_oemSymbolId)
243  RAW_METHOD_DUMP(OS, get_offsetInUdt)
244  RAW_METHOD_DUMP(OS, get_platform)
245  RAW_METHOD_DUMP(OS, get_rank)
246  RAW_METHOD_DUMP(OS, get_registerId)
247  RAW_METHOD_DUMP(OS, get_registerType)
248  RAW_METHOD_DUMP(OS, get_relativeVirtualAddress)
249  RAW_METHOD_DUMP(OS, get_samplerSlot)
250  RAW_METHOD_DUMP(OS, get_signature)
251  RAW_METHOD_DUMP(OS, get_sizeInUdt)
252  RAW_METHOD_DUMP(OS, get_slot)
253  RAW_METHOD_DUMP(OS, get_sourceFileName)
254  RAW_METHOD_DUMP(OS, get_stride)
255  RAW_METHOD_DUMP(OS, get_subTypeId)
256  RAW_METHOD_DUMP(OS, get_symbolsFileName)
257  RAW_METHOD_DUMP(OS, get_symIndexId)
258  RAW_METHOD_DUMP(OS, get_targetOffset)
259  RAW_METHOD_DUMP(OS, get_targetRelativeVirtualAddress)
260  RAW_METHOD_DUMP(OS, get_targetVirtualAddress)
261  RAW_METHOD_DUMP(OS, get_targetSection)
262  RAW_METHOD_DUMP(OS, get_textureSlot)
263  RAW_METHOD_DUMP(OS, get_timeStamp)
264  RAW_METHOD_DUMP(OS, get_token)
265  RAW_METHOD_DUMP(OS, get_typeId)
266  RAW_METHOD_DUMP(OS, get_uavSlot)
267  RAW_METHOD_DUMP(OS, get_undecoratedName)
268  RAW_METHOD_DUMP(OS, get_unmodifiedTypeId)
269  RAW_METHOD_DUMP(OS, get_upperBoundId)
270  RAW_METHOD_DUMP(OS, get_virtualBaseDispIndex)
271  RAW_METHOD_DUMP(OS, get_virtualBaseOffset)
272  RAW_METHOD_DUMP(OS, get_virtualTableShapeId)
273  RAW_METHOD_DUMP(OS, get_dataKind)
274  RAW_METHOD_DUMP(OS, get_symTag)
275  RAW_METHOD_DUMP(OS, get_guid)
276  RAW_METHOD_DUMP(OS, get_offset)
277  RAW_METHOD_DUMP(OS, get_thisAdjust)
278  RAW_METHOD_DUMP(OS, get_virtualBasePointerOffset)
279  RAW_METHOD_DUMP(OS, get_locationType)
280  RAW_METHOD_DUMP(OS, get_machineType)
281  RAW_METHOD_DUMP(OS, get_thunkOrdinal)
282  RAW_METHOD_DUMP(OS, get_length)
283  RAW_METHOD_DUMP(OS, get_liveRangeLength)
284  RAW_METHOD_DUMP(OS, get_virtualAddress)
285  RAW_METHOD_DUMP(OS, get_udtKind)
286  RAW_METHOD_DUMP(OS, get_constructor)
287  RAW_METHOD_DUMP(OS, get_customCallingConvention)
288  RAW_METHOD_DUMP(OS, get_farReturn)
289  RAW_METHOD_DUMP(OS, get_code)
290  RAW_METHOD_DUMP(OS, get_compilerGenerated)
291  RAW_METHOD_DUMP(OS, get_constType)
292  RAW_METHOD_DUMP(OS, get_editAndContinueEnabled)
293  RAW_METHOD_DUMP(OS, get_function)
294  RAW_METHOD_DUMP(OS, get_stride)
295  RAW_METHOD_DUMP(OS, get_noStackOrdering)
296  RAW_METHOD_DUMP(OS, get_hasAlloca)
297  RAW_METHOD_DUMP(OS, get_hasAssignmentOperator)
298  RAW_METHOD_DUMP(OS, get_isCTypes)
299  RAW_METHOD_DUMP(OS, get_hasCastOperator)
300  RAW_METHOD_DUMP(OS, get_hasDebugInfo)
301  RAW_METHOD_DUMP(OS, get_hasEH)
302  RAW_METHOD_DUMP(OS, get_hasEHa)
303  RAW_METHOD_DUMP(OS, get_hasInlAsm)
304  RAW_METHOD_DUMP(OS, get_framePointerPresent)
305  RAW_METHOD_DUMP(OS, get_inlSpec)
306  RAW_METHOD_DUMP(OS, get_interruptReturn)
307  RAW_METHOD_DUMP(OS, get_hasLongJump)
308  RAW_METHOD_DUMP(OS, get_hasManagedCode)
309  RAW_METHOD_DUMP(OS, get_hasNestedTypes)
310  RAW_METHOD_DUMP(OS, get_noInline)
311  RAW_METHOD_DUMP(OS, get_noReturn)
312  RAW_METHOD_DUMP(OS, get_optimizedCodeDebugInfo)
313  RAW_METHOD_DUMP(OS, get_overloadedOperator)
314  RAW_METHOD_DUMP(OS, get_hasSEH)
315  RAW_METHOD_DUMP(OS, get_hasSecurityChecks)
316  RAW_METHOD_DUMP(OS, get_hasSetJump)
317  RAW_METHOD_DUMP(OS, get_strictGSCheck)
318  RAW_METHOD_DUMP(OS, get_isAcceleratorGroupSharedLocal)
319  RAW_METHOD_DUMP(OS, get_isAcceleratorPointerTagLiveRange)
320  RAW_METHOD_DUMP(OS, get_isAcceleratorStubFunction)
321  RAW_METHOD_DUMP(OS, get_isAggregated)
322  RAW_METHOD_DUMP(OS, get_intro)
323  RAW_METHOD_DUMP(OS, get_isCVTCIL)
324  RAW_METHOD_DUMP(OS, get_isConstructorVirtualBase)
325  RAW_METHOD_DUMP(OS, get_isCxxReturnUdt)
326  RAW_METHOD_DUMP(OS, get_isDataAligned)
327  RAW_METHOD_DUMP(OS, get_isHLSLData)
328  RAW_METHOD_DUMP(OS, get_isHotpatchable)
329  RAW_METHOD_DUMP(OS, get_indirectVirtualBaseClass)
330  RAW_METHOD_DUMP(OS, get_isInterfaceUdt)
331  RAW_METHOD_DUMP(OS, get_intrinsic)
332  RAW_METHOD_DUMP(OS, get_isLTCG)
333  RAW_METHOD_DUMP(OS, get_isLocationControlFlowDependent)
334  RAW_METHOD_DUMP(OS, get_isMSILNetmodule)
335  RAW_METHOD_DUMP(OS, get_isMatrixRowMajor)
336  RAW_METHOD_DUMP(OS, get_managed)
337  RAW_METHOD_DUMP(OS, get_msil)
338  RAW_METHOD_DUMP(OS, get_isMultipleInheritance)
339  RAW_METHOD_DUMP(OS, get_isNaked)
340  RAW_METHOD_DUMP(OS, get_nested)
341  RAW_METHOD_DUMP(OS, get_isOptimizedAway)
342  RAW_METHOD_DUMP(OS, get_packed)
343  RAW_METHOD_DUMP(OS, get_isPointerBasedOnSymbolValue)
344  RAW_METHOD_DUMP(OS, get_isPointerToDataMember)
345  RAW_METHOD_DUMP(OS, get_isPointerToMemberFunction)
346  RAW_METHOD_DUMP(OS, get_pure)
347  RAW_METHOD_DUMP(OS, get_RValueReference)
348  RAW_METHOD_DUMP(OS, get_isRefUdt)
349  RAW_METHOD_DUMP(OS, get_reference)
350  RAW_METHOD_DUMP(OS, get_restrictedType)
351  RAW_METHOD_DUMP(OS, get_isReturnValue)
352  RAW_METHOD_DUMP(OS, get_isSafeBuffers)
353  RAW_METHOD_DUMP(OS, get_scoped)
354  RAW_METHOD_DUMP(OS, get_isSdl)
355  RAW_METHOD_DUMP(OS, get_isSingleInheritance)
356  RAW_METHOD_DUMP(OS, get_isSplitted)
357  RAW_METHOD_DUMP(OS, get_isStatic)
358  RAW_METHOD_DUMP(OS, get_isStripped)
359  RAW_METHOD_DUMP(OS, get_unalignedType)
360  RAW_METHOD_DUMP(OS, get_notReached)
361  RAW_METHOD_DUMP(OS, get_isValueUdt)
362  RAW_METHOD_DUMP(OS, get_virtual)
363  RAW_METHOD_DUMP(OS, get_virtualBaseClass)
364  RAW_METHOD_DUMP(OS, get_isVirtualInheritance)
365  RAW_METHOD_DUMP(OS, get_volatileType)
366  RAW_METHOD_DUMP(OS, get_wasInlined)
367  RAW_METHOD_DUMP(OS, get_unused)
368  RAW_METHOD_DUMP(OS, get_value)
369 }
370 
371 std::unique_ptr<IPDBEnumSymbols>
373  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
374 
375  CComPtr<IDiaEnumSymbols> DiaEnumerator;
376  if (S_OK !=
377  Symbol->findChildrenEx(EnumVal, nullptr, nsNone, &DiaEnumerator)) {
378  if (S_OK != Symbol->findChildren(EnumVal, nullptr, nsNone, &DiaEnumerator))
379  return nullptr;
380  }
381 
382  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
383 }
384 
385 std::unique_ptr<IPDBEnumSymbols>
387  PDB_NameSearchFlags Flags) const {
389  llvm::convertUTF8ToUTF16String(Name, Name16);
390 
391  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
392  DWORD CompareFlags = static_cast<DWORD>(Flags);
393  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
394 
395  CComPtr<IDiaEnumSymbols> DiaEnumerator;
396  if (S_OK !=
397  Symbol->findChildrenEx(EnumVal, Name16Str, CompareFlags, &DiaEnumerator))
398  return nullptr;
399 
400  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
401 }
402 
403 std::unique_ptr<IPDBEnumSymbols>
406  uint32_t Offset) const {
408  llvm::convertUTF8ToUTF16String(Name, Name16);
409 
410  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
411 
412  DWORD CompareFlags = static_cast<DWORD>(Flags);
413  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
414 
415  CComPtr<IDiaEnumSymbols> DiaEnumerator;
416  if (S_OK !=
417  Symbol->findChildrenExByAddr(EnumVal, Name16Str, CompareFlags, Section,
418  Offset, &DiaEnumerator))
419  return nullptr;
420 
421  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
422 }
423 
424 std::unique_ptr<IPDBEnumSymbols>
426  PDB_NameSearchFlags Flags, uint64_t VA) const {
428  llvm::convertUTF8ToUTF16String(Name, Name16);
429 
430  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
431 
432  DWORD CompareFlags = static_cast<DWORD>(Flags);
433  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
434 
435  CComPtr<IDiaEnumSymbols> DiaEnumerator;
436  if (S_OK !=
437  Symbol->findChildrenExByVA(EnumVal, Name16Str, CompareFlags, VA,
438  &DiaEnumerator))
439  return nullptr;
440 
441  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
442 }
443 
444 std::unique_ptr<IPDBEnumSymbols>
446  PDB_NameSearchFlags Flags, uint32_t RVA) const {
448  llvm::convertUTF8ToUTF16String(Name, Name16);
449 
450  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
451  DWORD CompareFlags = static_cast<DWORD>(Flags);
452  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
453 
454  CComPtr<IDiaEnumSymbols> DiaEnumerator;
455  if (S_OK !=
456  Symbol->findChildrenExByRVA(EnumVal, Name16Str, CompareFlags, RVA,
457  &DiaEnumerator))
458  return nullptr;
459 
460  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
461 }
462 
463 std::unique_ptr<IPDBEnumSymbols>
465  CComPtr<IDiaEnumSymbols> DiaEnumerator;
466  if (S_OK != Symbol->findInlineFramesByAddr(Section, Offset, &DiaEnumerator))
467  return nullptr;
468 
469  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
470 }
471 
472 std::unique_ptr<IPDBEnumSymbols>
474  CComPtr<IDiaEnumSymbols> DiaEnumerator;
475  if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator))
476  return nullptr;
477 
478  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
479 }
480 
481 std::unique_ptr<IPDBEnumSymbols>
483  CComPtr<IDiaEnumSymbols> DiaEnumerator;
484  if (S_OK != Symbol->findInlineFramesByVA(VA, &DiaEnumerator))
485  return nullptr;
486 
487  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
488 }
489 
490 std::unique_ptr<IPDBEnumLineNumbers> DIARawSymbol::findInlineeLines() const {
491  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
492  if (S_OK != Symbol->findInlineeLines(&DiaEnumerator))
493  return nullptr;
494 
495  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
496 }
497 
498 std::unique_ptr<IPDBEnumLineNumbers>
500  uint32_t Length) const {
501  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
502  if (S_OK != Symbol->findInlineeLinesByAddr(Section, Offset, Length, &DiaEnumerator))
503  return nullptr;
504 
505  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
506 }
507 
508 std::unique_ptr<IPDBEnumLineNumbers>
510  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
511  if (S_OK != Symbol->findInlineeLinesByRVA(RVA, Length, &DiaEnumerator))
512  return nullptr;
513 
514  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
515 }
516 
517 std::unique_ptr<IPDBEnumLineNumbers>
518 DIARawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
519  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
520  if (S_OK != Symbol->findInlineeLinesByVA(VA, Length, &DiaEnumerator))
521  return nullptr;
522 
523  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
524 }
525 
527  bytes.clear();
528 
529  DWORD DataSize = 0;
530  Symbol->get_dataBytes(0, &DataSize, nullptr);
531  if (DataSize == 0)
532  return;
533 
534  bytes.resize(DataSize);
535  Symbol->get_dataBytes(DataSize, &DataSize, bytes.data());
536 }
537 
538 std::string
540  CComBSTR Result16;
541  if (S_OK != Symbol->get_undecoratedNameEx((DWORD)Flags, &Result16))
542  return std::string();
543 
544  const char *SrcBytes = reinterpret_cast<const char *>(Result16.m_str);
545  llvm::ArrayRef<char> SrcByteArray(SrcBytes, Result16.ByteLength());
546  std::string Result8;
547  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
548  return std::string();
549  return Result8;
550 }
551 
553  return PrivateGetDIAValue<DWORD, PDB_MemberAccess>(Symbol,
554  &IDiaSymbol::get_access);
555 }
556 
558  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressOffset);
559 }
560 
562  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressSection);
563 }
564 
566  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_age);
567 }
568 
570  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_arrayIndexTypeId);
571 }
572 
574  Version.Major = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndMajor);
575  Version.Minor = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndMinor);
576  Version.Build = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndBuild);
577  Version.QFE = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndQFE);
578 }
579 
581  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseDataOffset);
582 }
583 
585  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseDataSlot);
586 }
587 
589  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseSymbolId);
590 }
591 
593  return PrivateGetDIAValue<DWORD, PDB_BuiltinType>(Symbol,
594  &IDiaSymbol::get_baseType);
595 }
596 
598  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_bitPosition);
599 }
600 
602  return PrivateGetDIAValue<DWORD, PDB_CallingConv>(
603  Symbol, &IDiaSymbol::get_callingConvention);
604 }
605 
607  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_classParentId);
608 }
609 
610 std::string DIARawSymbol::getCompilerName() const {
611  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_compilerName);
612 }
613 
615  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_count);
616 }
617 
619  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_countLiveRanges);
620 }
621 
623  Version.Major = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndMajor);
624  Version.Minor = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndMinor);
625  Version.Build = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndBuild);
626  Version.QFE = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndQFE);
627 }
628 
630  return PrivateGetDIAValue<DWORD, PDB_Lang>(Symbol, &IDiaSymbol::get_language);
631 }
632 
634  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_lexicalParentId);
635 }
636 
637 std::string DIARawSymbol::getLibraryName() const {
638  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_libraryName);
639 }
640 
642  return PrivateGetDIAValue(Symbol,
643  &IDiaSymbol::get_liveRangeStartAddressOffset);
644 }
645 
647  return PrivateGetDIAValue(Symbol,
648  &IDiaSymbol::get_liveRangeStartAddressSection);
649 }
650 
652  return PrivateGetDIAValue(
653  Symbol, &IDiaSymbol::get_liveRangeStartRelativeVirtualAddress);
654 }
655 
657  return PrivateGetDIAValue<DWORD, codeview::RegisterId>(
658  Symbol, &IDiaSymbol::get_localBasePointerRegisterId);
659 }
660 
662  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_lowerBoundId);
663 }
664 
666  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_memorySpaceKind);
667 }
668 
669 std::string DIARawSymbol::getName() const {
670  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_name);
671 }
672 
674  return PrivateGetDIAValue(Symbol,
675  &IDiaSymbol::get_numberOfAcceleratorPointerTags);
676 }
677 
679  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfColumns);
680 }
681 
683  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfModifiers);
684 }
685 
687  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfRegisterIndices);
688 }
689 
691  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfRows);
692 }
693 
694 std::string DIARawSymbol::getObjectFileName() const {
695  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_objectFileName);
696 }
697 
699  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_oemId);
700 }
701 
703  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_oemSymbolId);
704 }
705 
707  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_offsetInUdt);
708 }
709 
711  return PrivateGetDIAValue<DWORD, PDB_Cpu>(Symbol, &IDiaSymbol::get_platform);
712 }
713 
715  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_rank);
716 }
717 
719  return PrivateGetDIAValue<DWORD, codeview::RegisterId>(
720  Symbol, &IDiaSymbol::get_registerId);
721 }
722 
724  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_registerType);
725 }
726 
728  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_relativeVirtualAddress);
729 }
730 
732  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_samplerSlot);
733 }
734 
736  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_signature);
737 }
738 
740  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sizeInUdt);
741 }
742 
744  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_slot);
745 }
746 
747 std::string DIARawSymbol::getSourceFileName() const {
748  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sourceFileName);
749 }
750 
752  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_stride);
753 }
754 
756  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_subTypeId);
757 }
758 
759 std::string DIARawSymbol::getSymbolsFileName() const {
760  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_symbolsFileName);
761 }
762 
764  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_symIndexId);
765 }
766 
768  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetOffset);
769 }
770 
772  return PrivateGetDIAValue(Symbol,
773  &IDiaSymbol::get_targetRelativeVirtualAddress);
774 }
775 
777  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetVirtualAddress);
778 }
779 
781  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetSection);
782 }
783 
785  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_textureSlot);
786 }
787 
789  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_timeStamp);
790 }
791 
793  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_token);
794 }
795 
797  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_typeId);
798 }
799 
801  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_uavSlot);
802 }
803 
804 std::string DIARawSymbol::getUndecoratedName() const {
805  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_undecoratedName);
806 }
807 
809  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unmodifiedTypeId);
810 }
811 
813  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_upperBoundId);
814 }
815 
817  VARIANT Value;
818  Value.vt = VT_EMPTY;
819  if (S_OK != Symbol->get_value(&Value))
820  return Variant();
821 
822  return VariantFromVARIANT(Value);
823 }
824 
826  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseDispIndex);
827 }
828 
830  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseOffset);
831 }
832 
834  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualTableShapeId);
835 }
836 
837 std::unique_ptr<PDBSymbolTypeBuiltin>
839  CComPtr<IDiaSymbol> TableType;
840  if (FAILED(Symbol->get_virtualBaseTableType(&TableType)) || !TableType)
841  return nullptr;
842 
843  auto RawVT = llvm::make_unique<DIARawSymbol>(Session, TableType);
844  auto Pointer =
845  llvm::make_unique<PDBSymbolTypePointer>(Session, std::move(RawVT));
846  return unique_dyn_cast<PDBSymbolTypeBuiltin>(Pointer->getPointeeType());
847 }
848 
850  return PrivateGetDIAValue<DWORD, PDB_DataKind>(Symbol,
851  &IDiaSymbol::get_dataKind);
852 }
853 
855  return PrivateGetDIAValue<DWORD, PDB_SymType>(Symbol,
856  &IDiaSymbol::get_symTag);
857 }
858 
860  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_guid);
861 }
862 
863 int32_t DIARawSymbol::getOffset() const {
864  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_offset);
865 }
866 
868  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_thisAdjust);
869 }
870 
872  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBasePointerOffset);
873 }
874 
876  return PrivateGetDIAValue<DWORD, PDB_LocType>(Symbol,
877  &IDiaSymbol::get_locationType);
878 }
879 
881  return PrivateGetDIAValue<DWORD, PDB_Machine>(Symbol,
882  &IDiaSymbol::get_machineType);
883 }
884 
886  return PrivateGetDIAValue<DWORD, codeview::ThunkOrdinal>(
887  Symbol, &IDiaSymbol::get_thunkOrdinal);
888 }
889 
890 uint64_t DIARawSymbol::getLength() const {
891  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_length);
892 }
893 
895  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_liveRangeLength);
896 }
897 
899  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualAddress);
900 }
901 
903  return PrivateGetDIAValue<DWORD, PDB_UdtType>(Symbol,
904  &IDiaSymbol::get_udtKind);
905 }
906 
908  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_constructor);
909 }
910 
912  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_customCallingConvention);
913 }
914 
916  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_farReturn);
917 }
918 
919 bool DIARawSymbol::isCode() const {
920  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_code);
921 }
922 
924  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_compilerGenerated);
925 }
926 
928  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_constType);
929 }
930 
932  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_editAndContinueEnabled);
933 }
934 
936  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_function);
937 }
938 
940  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressTaken);
941 }
942 
944  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noStackOrdering);
945 }
946 
948  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasAlloca);
949 }
950 
952  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasAssignmentOperator);
953 }
954 
956  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCTypes);
957 }
958 
960  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasCastOperator);
961 }
962 
964  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasDebugInfo);
965 }
966 
967 bool DIARawSymbol::hasEH() const {
968  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasEH);
969 }
970 
971 bool DIARawSymbol::hasEHa() const {
972  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasEHa);
973 }
974 
976  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasInlAsm);
977 }
978 
980  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_inlSpec);
981 }
982 
984  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_interruptReturn);
985 }
986 
988  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_framePointerPresent);
989 }
990 
992  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasLongJump);
993 }
994 
996  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasManagedCode);
997 }
998 
1000  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasNestedTypes);
1001 }
1002 
1004  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noInline);
1005 }
1006 
1008  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noReturn);
1009 }
1010 
1012  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_optimizedCodeDebugInfo);
1013 }
1014 
1016  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_overloadedOperator);
1017 }
1018 
1019 bool DIARawSymbol::hasSEH() const {
1020  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSEH);
1021 }
1022 
1024  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSecurityChecks);
1025 }
1026 
1028  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSetJump);
1029 }
1030 
1032  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_strictGSCheck);
1033 }
1034 
1036  return PrivateGetDIAValue(Symbol,
1037  &IDiaSymbol::get_isAcceleratorGroupSharedLocal);
1038 }
1039 
1041  return PrivateGetDIAValue(Symbol,
1042  &IDiaSymbol::get_isAcceleratorPointerTagLiveRange);
1043 }
1044 
1046  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isAcceleratorStubFunction);
1047 }
1048 
1050  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isAggregated);
1051 }
1052 
1054  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_intro);
1055 }
1056 
1058  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCVTCIL);
1059 }
1060 
1062  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isConstructorVirtualBase);
1063 }
1064 
1066  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCxxReturnUdt);
1067 }
1068 
1070  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isDataAligned);
1071 }
1072 
1074  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isHLSLData);
1075 }
1076 
1078  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isHotpatchable);
1079 }
1080 
1082  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_indirectVirtualBaseClass);
1083 }
1084 
1086  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isInterfaceUdt);
1087 }
1088 
1090  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_intrinsic);
1091 }
1092 
1093 bool DIARawSymbol::isLTCG() const {
1094  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isLTCG);
1095 }
1096 
1098  return PrivateGetDIAValue(Symbol,
1099  &IDiaSymbol::get_isLocationControlFlowDependent);
1100 }
1101 
1103  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMSILNetmodule);
1104 }
1105 
1107  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMatrixRowMajor);
1108 }
1109 
1111  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_managed);
1112 }
1113 
1115  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_msil);
1116 }
1117 
1119  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMultipleInheritance);
1120 }
1121 
1123  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isNaked);
1124 }
1125 
1127  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_nested);
1128 }
1129 
1131  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isOptimizedAway);
1132 }
1133 
1135  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_packed);
1136 }
1137 
1139  return PrivateGetDIAValue(Symbol,
1140  &IDiaSymbol::get_isPointerBasedOnSymbolValue);
1141 }
1142 
1144  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isPointerToDataMember);
1145 }
1146 
1148  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isPointerToMemberFunction);
1149 }
1150 
1152  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_pure);
1153 }
1154 
1156  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_RValueReference);
1157 }
1158 
1160  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isRefUdt);
1161 }
1162 
1164  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_reference);
1165 }
1166 
1168  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_restrictedType);
1169 }
1170 
1172  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isReturnValue);
1173 }
1174 
1176  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSafeBuffers);
1177 }
1178 
1180  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_scoped);
1181 }
1182 
1183 bool DIARawSymbol::isSdl() const {
1184  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSdl);
1185 }
1186 
1188  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSingleInheritance);
1189 }
1190 
1192  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSplitted);
1193 }
1194 
1196  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isStatic);
1197 }
1198 
1200  // hasPrivateSymbols is the opposite of isStripped, but we expose
1201  // hasPrivateSymbols as a more intuitive interface.
1202  return !PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isStripped);
1203 }
1204 
1206  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unalignedType);
1207 }
1208 
1210  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_notReached);
1211 }
1212 
1214  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isValueUdt);
1215 }
1216 
1218  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtual);
1219 }
1220 
1222  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseClass);
1223 }
1224 
1226  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isVirtualInheritance);
1227 }
1228 
1230  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_volatileType);
1231 }
1232 
1234  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_wasInlined);
1235 }
1236 
1237 std::string DIARawSymbol::getUnused() const {
1238  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unused);
1239 }
bool hasAlloca() const override
bool hasInlineAttribute() const override
bool hasNoReturnAttribute() const override
uint32_t getOemSymbolId() const override
uint32_t getToken() const override
uint32_t getLiveRangeStartRelativeVirtualAddress() const override
bool hasInterruptReturn() const override
bool isRValueReference() const override
std::unique_ptr< IPDBEnumSymbols > findInlineFramesByVA(uint64_t VA) const override
std::unique_ptr< IPDBEnumSymbols > findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const override
PDB_UdtType getUdtKind() const override
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
int32_t getOffset() const override
bool isStatic() const override
codeview::RegisterId getLocalBasePointerRegisterId() const override
uint32_t getNumberOfColumns() const override
uint32_t getTargetOffset() const override
LLVM_NODISCARD auto unique_dyn_cast(std::unique_ptr< Y > &Val) -> decltype(cast< X >(Val))
Definition: Casting.h:368
bool hasOptimizedCodeDebugInfo() const override
PDB_UdtType
These values correspond to the UdtKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx.
Definition: PDBTypes.h:217
uint32_t getTextureSlot() const override
uint32_t getSubTypeId() const override
bool isNaked() const override
uint32_t getVirtualBaseDispIndex() const override
raw_ostream & indent(unsigned NumSpaces)
indent - Insert &#39;NumSpaces&#39; spaces.
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Definition: PDBTypes.h:93
bool isValueUdt() const override
std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByAddr(uint32_t Section, uint32_t Offset, uint32_t Length) const override
uint32_t getVirtualTableShapeId() const override
std::string getUnused() const override
bool isConstructorVirtualBase() const override
bool getNoStackOrdering() const override
bool isPureVirtual() const override
bool isSdl() const override
std::string getSymbolsFileName() const override
std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override
bool isFunction() const override
bool isReturnValue() const override
PDB_Machine getMachineType() const override
bool isRefUdt() const override
bool hasManagedCode() const override
bool isVirtual() const override
bool hasOverloadedOperator() const override
raw_ostream & operator<<(raw_ostream &OS, const PDB_VariantType &Value)
Definition: PDBExtras.cpp:25
bool hasCastOperator() const override
uint32_t getUnmodifiedTypeId() const override
uint32_t getStride() const override
uint32_t getUpperBoundId() const override
bool hasEHa() const override
bool isIntroVirtualFunction() const override
uint32_t getNumberOfRegisterIndices() const override
std::string getName() const override
codeview::ThunkOrdinal getThunkOrdinal() const override
void format(raw_ostream &Stream, StringRef Style) override
Definition: Formatters.cpp:27
This represents the &#39;GUID&#39; type from windows.h.
Definition: GUID.h:22
union llvm::pdb::Variant::@190 Value
bool isScoped() const override
std::string getUndecoratedNameEx(PDB_UndnameFlags Flags) const override
bool isCxxReturnUdt() const override
bool isVolatileType() const override
uint32_t getNumberOfAcceleratorPointerTags() const override
PDB_SymType getSymTag() const override
uint32_t getArrayIndexTypeId() const override
bool isNested() const override
bool isMSILNetmodule() const override
bool isPointerToMemberFunction() const override
uint64_t getLength() const override
bool isOptimizedAway() const override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
bool isIndirectVirtualBaseClass() const override
std::unique_ptr< IPDBEnumSymbols > findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint64_t VA) const override
uint32_t getTimeStamp() const override
bool isIntrinsic() const override
PDB_UndnameFlags
These values correspond to the flags that can be combined to control the return of an undecorated nam...
Definition: PDBTypes.h:255
bool convertUTF8ToUTF16String(StringRef SrcUTF8, SmallVectorImpl< UTF16 > &DstUTF16)
Converts a UTF-8 string into a UTF-16 string with native endianness.
void getFrontEndVersion(VersionInfo &Version) const override
PDB_BuiltinType getBuiltinType() const override
bool hasCustomCallingConvention() const override
uint32_t getLiveRangeStartAddressOffset() const override
bool isLocationControlFlowDependent() const override
bool isAcceleratorPointerTagLiveRange() const override
bool isRestrictedType() const override
bool hasCTypes() const override
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
Definition: PDBTypes.h:163
uint32_t getRank() const override
PDB_MemberAccess getAccess() const override
uint32_t UInt32
Definition: PDBTypes.h:327
bool getAddressTaken() const override
uint32_t getTargetSection() const override
uint32_t getRegisterType() const override
bool isAcceleratorGroupSharedLocal() const override
bool isEditAndContinueEnabled() const override
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
PDB_DataKind
These values correspond to the DataKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx.
Definition: PDBTypes.h:148
void getDataBytes(llvm::SmallVector< uint8_t, 32 > &bytes) const override
bool isPointerBasedOnSymbolValue() const override
uint32_t getSymIndexId() const override
uint32_t getOffsetInUdt() const override
bool isAcceleratorStubFunction() const override
std::unique_ptr< IPDBEnumSymbols > findChildrenByAddr(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const override
bool isDataAligned() const override
uint64_t getTargetVirtualAddress() const override
bool hasNestedTypes() const override
codeview::GUID getGuid() const override
bool isVirtualBaseClass() const override
bool hasEH() const override
uint32_t getLexicalParentId() const override
bool wasInlined() const override
bool isAggregated() const override
bool isMSILCode() const override
uint32_t getSizeInUdt() const override
PDB_LocType
These values correspond to the LocationType enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:200
uint32_t getTargetRelativeVirtualAddress() const override
uint64_t UInt64
Definition: PDBTypes.h:328
bool isPacked() const override
PDB_CallingConv getCallingConvention() const override
std::string getCompilerName() const override
uint64_t getLiveRangeLength() const override
bool isConstType() const override
bool isCode() const override
uint32_t getSignature() const override
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
Definition: CodeView.h:144
bool hasSEH() const override
std::unique_ptr< IPDBEnumSymbols > findInlineFramesByRVA(uint32_t RVA) const override
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:862
bool isCVTCIL() const override
int32_t getVirtualBasePointerOffset() const override
bool isManagedCode() const override
bool hasPrivateSymbols() const override
bool isSafeBuffers() const override
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Definition: CodeView.h:79
int32_t getThisAdjust() const override
std::string getLibraryName() const override
const DataFlowGraph & G
Definition: RDFGraph.cpp:211
codeview::RegisterId getRegisterId() const override
bool isMatrixRowMajor() const override
bool isHLSLData() const override
uint32_t getSlot() const override
std::unique_ptr< IPDBEnumLineNumbers > findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const override
uint32_t getLowerBoundId() const override
bool hasLongJump() const override
bool hasAssignmentOperator() const override
uint32_t getVirtualBaseOffset() const override
DIARawSymbol(const DIASession &PDBSession, CComPtr< IDiaSymbol > DiaSymbol)
std::string getSourceFileName() const override
uint32_t getBaseDataOffset() const override
bool convertUTF16ToUTF8String(ArrayRef< char > SrcBytes, std::string &Out)
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
bool hasSetJump() const override
bool isVirtualInheritance() const override
bool isUnreached() const override
bool isPointerToDataMember() const override
uint32_t getNumberOfModifiers() const override
PDB_LocType getLocationType() const override
bool hasStrictGSCheck() const override
pointer data()
Return a pointer to the vector&#39;s buffer, even if empty().
Definition: SmallVector.h:143
bool hasSecurityChecks() const override
void getBackEndVersion(VersionInfo &Version) const override
std::unique_ptr< IPDBEnumLineNumbers > findInlineeLines() const override
bool hasFramePointer() const override
#define RAW_METHOD_DUMP(Stream, Method)
uint32_t getNumberOfRows() const override
std::string getUndecoratedName() const override
uint32_t getAddressSection() const override
uint32_t getAge() const override
PDB_Cpu getPlatform() const override
uint16_t UInt16
Definition: PDBTypes.h:326
uint32_t getOemId() const override
bool isHotpatchable() const override
bool isMultipleInheritance() const override
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:514
PDB_BuiltinType
These values correspond to the Basictype enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx.
Definition: PDBTypes.h:229
std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type) const override
bool hasNoInlineAttribute() const override
bool isLTCG() const override
uint32_t getCount() const override
LLVM Value Representation.
Definition: Value.h:73
bool isSplitted() const override
uint64_t getVirtualAddress() const override
std::unique_ptr< IPDBEnumSymbols > findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const override
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition: CodeView.h:173
uint32_t getMemorySpaceKind() const override
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
bool isCompilerGenerated() const override
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Variant getValue() const override
bool isSingleInheritance() const override
uint32_t getLiveRangeStartAddressSection() const override
PDB_Lang getLanguage() const override
void dump(raw_ostream &OS, int Indent) const override
PDB_VariantType Type
Definition: PDBTypes.h:316
std::string getObjectFileName() const override
bool isInterfaceUdt() const override
bool isReference() const override
PDB_DataKind getDataKind() const override
bool hasInlAsm() const override
uint32_t getClassParentId() const override
uint32_t getAddressOffset() const override
uint32_t getUavSlot() const override
uint32_t getBitPosition() const override
uint32_t getBaseDataSlot() const override
const uint64_t Version
Definition: InstrProf.h:867
bool hasConstructor() const override
bool isUnalignedType() const override
uint32_t getCountLiveRanges() const override
uint32_t getSamplerSlot() const override
std::unique_ptr< PDBSymbolTypeBuiltin > getVirtualBaseTableType() const override
bool hasDebugInfo() const override
bool hasFarReturn() const override
uint32_t getTypeId() const override
uint32_t getRelativeVirtualAddress() const override
uint32_t getBaseSymbolId() const override
PDB_MemberAccess
Definition: PDBTypes.h:278
void resize(size_type N)
Definition: SmallVector.h:353