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"
25 
26 using namespace llvm;
27 using namespace llvm::pdb;
28 
29 namespace {
30 Variant VariantFromVARIANT(const VARIANT &V) {
31  Variant Result;
32  switch (V.vt) {
33  case VT_I1:
34  Result.Value.Int8 = V.cVal;
35  Result.Type = PDB_VariantType::Int8;
36  break;
37  case VT_I2:
38  Result.Value.Int16 = V.iVal;
40  break;
41  case VT_I4:
42  Result.Value.Int32 = V.intVal;
44  break;
45  case VT_I8:
46  Result.Value.Int64 = V.llVal;
48  break;
49  case VT_UI1:
50  Result.Value.UInt8 = V.bVal;
52  break;
53  case VT_UI2:
54  Result.Value.UInt16 = V.uiVal;
56  break;
57  case VT_UI4:
58  Result.Value.UInt32 = V.uintVal;
60  break;
61  case VT_UI8:
62  Result.Value.UInt64 = V.ullVal;
64  break;
65  case VT_BOOL:
66  Result.Value.Bool = (V.boolVal == VARIANT_TRUE) ? true : false;
67  Result.Type = PDB_VariantType::Bool;
68  break;
69  case VT_R4:
70  Result.Value.Single = V.fltVal;
72  break;
73  case VT_R8:
74  Result.Value.Double = V.dblVal;
76  break;
77  case VT_BSTR: {
78  const char *SrcBytes = reinterpret_cast<const char *>(V.bstrVal);
79  llvm::ArrayRef<char> SrcByteArray(SrcBytes, SysStringByteLen(V.bstrVal));
80  std::string Result8;
81  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
82  Result.Value.String = nullptr;
83  Result.Value.String = new char[Result8.length() + 1];
84  ::strcpy(Result.Value.String, Result8.c_str());
86  break;
87  }
88  default:
90  break;
91  }
92  return Result;
93 }
94 
95 template <typename ArgType>
96 ArgType PrivateGetDIAValue(IDiaSymbol *Symbol,
97  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
98  ArgType Value;
99  if (S_OK == (Symbol->*Method)(&Value))
100  return static_cast<ArgType>(Value);
101 
102  return ArgType();
103 }
104 
105 template <typename ArgType, typename RetType>
106 RetType PrivateGetDIAValue(IDiaSymbol *Symbol,
107  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
108  ArgType Value;
109  if (S_OK == (Symbol->*Method)(&Value))
110  return static_cast<RetType>(Value);
111 
112  return RetType();
113 }
114 
115 std::string
116 PrivateGetDIAValue(IDiaSymbol *Symbol,
117  HRESULT (__stdcall IDiaSymbol::*Method)(BSTR *)) {
118  CComBSTR Result16;
119  if (S_OK != (Symbol->*Method)(&Result16))
120  return std::string();
121 
122  const char *SrcBytes = reinterpret_cast<const char *>(Result16.m_str);
123  llvm::ArrayRef<char> SrcByteArray(SrcBytes, Result16.ByteLength());
124  std::string Result8;
125  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
126  return std::string();
127  return Result8;
128 }
129 
131 PrivateGetDIAValue(IDiaSymbol *Symbol,
132  HRESULT (__stdcall IDiaSymbol::*Method)(GUID *)) {
133  GUID Result;
134  if (S_OK != (Symbol->*Method)(&Result))
135  return codeview::GUID();
136 
137  static_assert(sizeof(codeview::GUID) == sizeof(GUID),
138  "GUID is the wrong size!");
139  codeview::GUID IdResult;
140  ::memcpy(&IdResult, &Result, sizeof(GUID));
141  return IdResult;
142 }
143 
144 template <typename ArgType>
145 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
146  IDiaSymbol *Symbol,
147  HRESULT (__stdcall IDiaSymbol::*Method)(ArgType *)) {
148  ArgType Value;
149  if (S_OK == (Symbol->*Method)(&Value)) {
150  OS << "\n";
151  OS.indent(Indent);
152  OS << Name << ": " << Value;
153  }
154 }
155 
156 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
157  IDiaSymbol *Symbol,
158  HRESULT (__stdcall IDiaSymbol::*Method)(BSTR *)) {
159  BSTR Value = nullptr;
160  if (S_OK != (Symbol->*Method)(&Value))
161  return;
162  const char *Bytes = reinterpret_cast<const char *>(Value);
163  ArrayRef<char> ByteArray(Bytes, ::SysStringByteLen(Value));
164  std::string Result;
165  if (llvm::convertUTF16ToUTF8String(ByteArray, Result)) {
166  OS << "\n";
167  OS.indent(Indent);
168  OS << Name << ": " << Result;
169  }
170  ::SysFreeString(Value);
171 }
172 
173 void DumpDIAValue(llvm::raw_ostream &OS, int Indent, StringRef Name,
174  IDiaSymbol *Symbol,
175  HRESULT (__stdcall IDiaSymbol::*Method)(VARIANT *)) {
176  VARIANT Value;
177  Value.vt = VT_EMPTY;
178  if (S_OK != (Symbol->*Method)(&Value))
179  return;
180  OS << "\n";
181  OS.indent(Indent);
182  Variant V = VariantFromVARIANT(Value);
183  OS << Name << ": " << V;
184 }
185 }
186 
187 namespace llvm {
189  StringRef GuidBytes(reinterpret_cast<const char *>(&G), sizeof(G));
190  codeview::detail::GuidAdapter A(GuidBytes);
191  A.format(OS, "");
192  return OS;
193 }
194 }
195 
197  CComPtr<IDiaSymbol> DiaSymbol)
198  : Session(PDBSession), Symbol(DiaSymbol) {}
199 
200 #define RAW_METHOD_DUMP(Stream, Method) \
201  DumpDIAValue(Stream, Indent, StringRef(#Method), Symbol, &IDiaSymbol::Method);
202 
203 void DIARawSymbol::dump(raw_ostream &OS, int Indent) const {
204  RAW_METHOD_DUMP(OS, get_access)
205  RAW_METHOD_DUMP(OS, get_addressOffset)
206  RAW_METHOD_DUMP(OS, get_addressSection)
207  RAW_METHOD_DUMP(OS, get_age)
208  RAW_METHOD_DUMP(OS, get_arrayIndexTypeId)
209  RAW_METHOD_DUMP(OS, get_backEndMajor)
210  RAW_METHOD_DUMP(OS, get_backEndMinor)
211  RAW_METHOD_DUMP(OS, get_backEndBuild)
212  RAW_METHOD_DUMP(OS, get_backEndQFE)
213  RAW_METHOD_DUMP(OS, get_baseDataOffset)
214  RAW_METHOD_DUMP(OS, get_baseDataSlot)
215  RAW_METHOD_DUMP(OS, get_baseSymbolId)
216  RAW_METHOD_DUMP(OS, get_baseType)
217  RAW_METHOD_DUMP(OS, get_bitPosition)
218  RAW_METHOD_DUMP(OS, get_callingConvention)
219  RAW_METHOD_DUMP(OS, get_classParentId)
220  RAW_METHOD_DUMP(OS, get_compilerName)
221  RAW_METHOD_DUMP(OS, get_count)
222  RAW_METHOD_DUMP(OS, get_countLiveRanges)
223  RAW_METHOD_DUMP(OS, get_frontEndMajor)
224  RAW_METHOD_DUMP(OS, get_frontEndMinor)
225  RAW_METHOD_DUMP(OS, get_frontEndBuild)
226  RAW_METHOD_DUMP(OS, get_frontEndQFE)
227  RAW_METHOD_DUMP(OS, get_lexicalParentId)
228  RAW_METHOD_DUMP(OS, get_libraryName)
229  RAW_METHOD_DUMP(OS, get_liveRangeStartAddressOffset)
230  RAW_METHOD_DUMP(OS, get_liveRangeStartAddressSection)
231  RAW_METHOD_DUMP(OS, get_liveRangeStartRelativeVirtualAddress)
232  RAW_METHOD_DUMP(OS, get_localBasePointerRegisterId)
233  RAW_METHOD_DUMP(OS, get_lowerBoundId)
234  RAW_METHOD_DUMP(OS, get_memorySpaceKind)
235  RAW_METHOD_DUMP(OS, get_name)
236  RAW_METHOD_DUMP(OS, get_numberOfAcceleratorPointerTags)
237  RAW_METHOD_DUMP(OS, get_numberOfColumns)
238  RAW_METHOD_DUMP(OS, get_numberOfModifiers)
239  RAW_METHOD_DUMP(OS, get_numberOfRegisterIndices)
240  RAW_METHOD_DUMP(OS, get_numberOfRows)
241  RAW_METHOD_DUMP(OS, get_objectFileName)
242  RAW_METHOD_DUMP(OS, get_oemId)
243  RAW_METHOD_DUMP(OS, get_oemSymbolId)
244  RAW_METHOD_DUMP(OS, get_offsetInUdt)
245  RAW_METHOD_DUMP(OS, get_platform)
246  RAW_METHOD_DUMP(OS, get_rank)
247  RAW_METHOD_DUMP(OS, get_registerId)
248  RAW_METHOD_DUMP(OS, get_registerType)
249  RAW_METHOD_DUMP(OS, get_relativeVirtualAddress)
250  RAW_METHOD_DUMP(OS, get_samplerSlot)
251  RAW_METHOD_DUMP(OS, get_signature)
252  RAW_METHOD_DUMP(OS, get_sizeInUdt)
253  RAW_METHOD_DUMP(OS, get_slot)
254  RAW_METHOD_DUMP(OS, get_sourceFileName)
255  RAW_METHOD_DUMP(OS, get_stride)
256  RAW_METHOD_DUMP(OS, get_subTypeId)
257  RAW_METHOD_DUMP(OS, get_symbolsFileName)
258  RAW_METHOD_DUMP(OS, get_symIndexId)
259  RAW_METHOD_DUMP(OS, get_targetOffset)
260  RAW_METHOD_DUMP(OS, get_targetRelativeVirtualAddress)
261  RAW_METHOD_DUMP(OS, get_targetVirtualAddress)
262  RAW_METHOD_DUMP(OS, get_targetSection)
263  RAW_METHOD_DUMP(OS, get_textureSlot)
264  RAW_METHOD_DUMP(OS, get_timeStamp)
265  RAW_METHOD_DUMP(OS, get_token)
266  RAW_METHOD_DUMP(OS, get_typeId)
267  RAW_METHOD_DUMP(OS, get_uavSlot)
268  RAW_METHOD_DUMP(OS, get_undecoratedName)
269  RAW_METHOD_DUMP(OS, get_unmodifiedTypeId)
270  RAW_METHOD_DUMP(OS, get_upperBoundId)
271  RAW_METHOD_DUMP(OS, get_virtualBaseDispIndex)
272  RAW_METHOD_DUMP(OS, get_virtualBaseOffset)
273  RAW_METHOD_DUMP(OS, get_virtualTableShapeId)
274  RAW_METHOD_DUMP(OS, get_dataKind)
275  RAW_METHOD_DUMP(OS, get_symTag)
276  RAW_METHOD_DUMP(OS, get_guid)
277  RAW_METHOD_DUMP(OS, get_offset)
278  RAW_METHOD_DUMP(OS, get_thisAdjust)
279  RAW_METHOD_DUMP(OS, get_virtualBasePointerOffset)
280  RAW_METHOD_DUMP(OS, get_locationType)
281  RAW_METHOD_DUMP(OS, get_machineType)
282  RAW_METHOD_DUMP(OS, get_thunkOrdinal)
283  RAW_METHOD_DUMP(OS, get_length)
284  RAW_METHOD_DUMP(OS, get_liveRangeLength)
285  RAW_METHOD_DUMP(OS, get_virtualAddress)
286  RAW_METHOD_DUMP(OS, get_udtKind)
287  RAW_METHOD_DUMP(OS, get_constructor)
288  RAW_METHOD_DUMP(OS, get_customCallingConvention)
289  RAW_METHOD_DUMP(OS, get_farReturn)
290  RAW_METHOD_DUMP(OS, get_code)
291  RAW_METHOD_DUMP(OS, get_compilerGenerated)
292  RAW_METHOD_DUMP(OS, get_constType)
293  RAW_METHOD_DUMP(OS, get_editAndContinueEnabled)
294  RAW_METHOD_DUMP(OS, get_function)
295  RAW_METHOD_DUMP(OS, get_stride)
296  RAW_METHOD_DUMP(OS, get_noStackOrdering)
297  RAW_METHOD_DUMP(OS, get_hasAlloca)
298  RAW_METHOD_DUMP(OS, get_hasAssignmentOperator)
299  RAW_METHOD_DUMP(OS, get_isCTypes)
300  RAW_METHOD_DUMP(OS, get_hasCastOperator)
301  RAW_METHOD_DUMP(OS, get_hasDebugInfo)
302  RAW_METHOD_DUMP(OS, get_hasEH)
303  RAW_METHOD_DUMP(OS, get_hasEHa)
304  RAW_METHOD_DUMP(OS, get_hasInlAsm)
305  RAW_METHOD_DUMP(OS, get_framePointerPresent)
306  RAW_METHOD_DUMP(OS, get_inlSpec)
307  RAW_METHOD_DUMP(OS, get_interruptReturn)
308  RAW_METHOD_DUMP(OS, get_hasLongJump)
309  RAW_METHOD_DUMP(OS, get_hasManagedCode)
310  RAW_METHOD_DUMP(OS, get_hasNestedTypes)
311  RAW_METHOD_DUMP(OS, get_noInline)
312  RAW_METHOD_DUMP(OS, get_noReturn)
313  RAW_METHOD_DUMP(OS, get_optimizedCodeDebugInfo)
314  RAW_METHOD_DUMP(OS, get_overloadedOperator)
315  RAW_METHOD_DUMP(OS, get_hasSEH)
316  RAW_METHOD_DUMP(OS, get_hasSecurityChecks)
317  RAW_METHOD_DUMP(OS, get_hasSetJump)
318  RAW_METHOD_DUMP(OS, get_strictGSCheck)
319  RAW_METHOD_DUMP(OS, get_isAcceleratorGroupSharedLocal)
320  RAW_METHOD_DUMP(OS, get_isAcceleratorPointerTagLiveRange)
321  RAW_METHOD_DUMP(OS, get_isAcceleratorStubFunction)
322  RAW_METHOD_DUMP(OS, get_isAggregated)
323  RAW_METHOD_DUMP(OS, get_intro)
324  RAW_METHOD_DUMP(OS, get_isCVTCIL)
325  RAW_METHOD_DUMP(OS, get_isConstructorVirtualBase)
326  RAW_METHOD_DUMP(OS, get_isCxxReturnUdt)
327  RAW_METHOD_DUMP(OS, get_isDataAligned)
328  RAW_METHOD_DUMP(OS, get_isHLSLData)
329  RAW_METHOD_DUMP(OS, get_isHotpatchable)
330  RAW_METHOD_DUMP(OS, get_indirectVirtualBaseClass)
331  RAW_METHOD_DUMP(OS, get_isInterfaceUdt)
332  RAW_METHOD_DUMP(OS, get_intrinsic)
333  RAW_METHOD_DUMP(OS, get_isLTCG)
334  RAW_METHOD_DUMP(OS, get_isLocationControlFlowDependent)
335  RAW_METHOD_DUMP(OS, get_isMSILNetmodule)
336  RAW_METHOD_DUMP(OS, get_isMatrixRowMajor)
337  RAW_METHOD_DUMP(OS, get_managed)
338  RAW_METHOD_DUMP(OS, get_msil)
339  RAW_METHOD_DUMP(OS, get_isMultipleInheritance)
340  RAW_METHOD_DUMP(OS, get_isNaked)
341  RAW_METHOD_DUMP(OS, get_nested)
342  RAW_METHOD_DUMP(OS, get_isOptimizedAway)
343  RAW_METHOD_DUMP(OS, get_packed)
344  RAW_METHOD_DUMP(OS, get_isPointerBasedOnSymbolValue)
345  RAW_METHOD_DUMP(OS, get_isPointerToDataMember)
346  RAW_METHOD_DUMP(OS, get_isPointerToMemberFunction)
347  RAW_METHOD_DUMP(OS, get_pure)
348  RAW_METHOD_DUMP(OS, get_RValueReference)
349  RAW_METHOD_DUMP(OS, get_isRefUdt)
350  RAW_METHOD_DUMP(OS, get_reference)
351  RAW_METHOD_DUMP(OS, get_restrictedType)
352  RAW_METHOD_DUMP(OS, get_isReturnValue)
353  RAW_METHOD_DUMP(OS, get_isSafeBuffers)
354  RAW_METHOD_DUMP(OS, get_scoped)
355  RAW_METHOD_DUMP(OS, get_isSdl)
356  RAW_METHOD_DUMP(OS, get_isSingleInheritance)
357  RAW_METHOD_DUMP(OS, get_isSplitted)
358  RAW_METHOD_DUMP(OS, get_isStatic)
359  RAW_METHOD_DUMP(OS, get_isStripped)
360  RAW_METHOD_DUMP(OS, get_unalignedType)
361  RAW_METHOD_DUMP(OS, get_notReached)
362  RAW_METHOD_DUMP(OS, get_isValueUdt)
363  RAW_METHOD_DUMP(OS, get_virtual)
364  RAW_METHOD_DUMP(OS, get_virtualBaseClass)
365  RAW_METHOD_DUMP(OS, get_isVirtualInheritance)
366  RAW_METHOD_DUMP(OS, get_volatileType)
367  RAW_METHOD_DUMP(OS, get_wasInlined)
368  RAW_METHOD_DUMP(OS, get_unused)
369  RAW_METHOD_DUMP(OS, get_value)
370 }
371 
372 std::unique_ptr<IPDBEnumSymbols>
374  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
375 
376  CComPtr<IDiaEnumSymbols> DiaEnumerator;
377  if (S_OK !=
378  Symbol->findChildrenEx(EnumVal, nullptr, nsNone, &DiaEnumerator)) {
379  if (S_OK != Symbol->findChildren(EnumVal, nullptr, nsNone, &DiaEnumerator))
380  return nullptr;
381  }
382 
383  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
384 }
385 
386 std::unique_ptr<IPDBEnumSymbols>
388  PDB_NameSearchFlags Flags) const {
390  llvm::convertUTF8ToUTF16String(Name, Name16);
391 
392  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
393  DWORD CompareFlags = static_cast<DWORD>(Flags);
394  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
395 
396  CComPtr<IDiaEnumSymbols> DiaEnumerator;
397  if (S_OK !=
398  Symbol->findChildrenEx(EnumVal, Name16Str, CompareFlags, &DiaEnumerator))
399  return nullptr;
400 
401  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
402 }
403 
404 std::unique_ptr<IPDBEnumSymbols>
407  uint32_t Offset) const {
409  llvm::convertUTF8ToUTF16String(Name, Name16);
410 
411  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
412 
413  DWORD CompareFlags = static_cast<DWORD>(Flags);
414  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
415 
416  CComPtr<IDiaEnumSymbols> DiaEnumerator;
417  if (S_OK !=
418  Symbol->findChildrenExByAddr(EnumVal, Name16Str, CompareFlags, Section,
419  Offset, &DiaEnumerator))
420  return nullptr;
421 
422  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
423 }
424 
425 std::unique_ptr<IPDBEnumSymbols>
427  PDB_NameSearchFlags Flags, uint64_t VA) const {
429  llvm::convertUTF8ToUTF16String(Name, Name16);
430 
431  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
432 
433  DWORD CompareFlags = static_cast<DWORD>(Flags);
434  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
435 
436  CComPtr<IDiaEnumSymbols> DiaEnumerator;
437  if (S_OK !=
438  Symbol->findChildrenExByVA(EnumVal, Name16Str, CompareFlags, VA,
439  &DiaEnumerator))
440  return nullptr;
441 
442  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
443 }
444 
445 std::unique_ptr<IPDBEnumSymbols>
447  PDB_NameSearchFlags Flags, uint32_t RVA) const {
449  llvm::convertUTF8ToUTF16String(Name, Name16);
450 
451  enum SymTagEnum EnumVal = static_cast<enum SymTagEnum>(Type);
452  DWORD CompareFlags = static_cast<DWORD>(Flags);
453  wchar_t *Name16Str = reinterpret_cast<wchar_t *>(Name16.data());
454 
455  CComPtr<IDiaEnumSymbols> DiaEnumerator;
456  if (S_OK !=
457  Symbol->findChildrenExByRVA(EnumVal, Name16Str, CompareFlags, RVA,
458  &DiaEnumerator))
459  return nullptr;
460 
461  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
462 }
463 
464 std::unique_ptr<IPDBEnumSymbols>
466  CComPtr<IDiaEnumSymbols> DiaEnumerator;
467  if (S_OK != Symbol->findInlineFramesByAddr(Section, Offset, &DiaEnumerator))
468  return nullptr;
469 
470  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
471 }
472 
473 std::unique_ptr<IPDBEnumSymbols>
475  CComPtr<IDiaEnumSymbols> DiaEnumerator;
476  if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator))
477  return nullptr;
478 
479  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
480 }
481 
482 std::unique_ptr<IPDBEnumSymbols>
484  CComPtr<IDiaEnumSymbols> DiaEnumerator;
485  if (S_OK != Symbol->findInlineFramesByVA(VA, &DiaEnumerator))
486  return nullptr;
487 
488  return llvm::make_unique<DIAEnumSymbols>(Session, DiaEnumerator);
489 }
490 
491 std::unique_ptr<IPDBEnumLineNumbers> DIARawSymbol::findInlineeLines() const {
492  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
493  if (S_OK != Symbol->findInlineeLines(&DiaEnumerator))
494  return nullptr;
495 
496  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
497 }
498 
499 std::unique_ptr<IPDBEnumLineNumbers>
501  uint32_t Length) const {
502  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
503  if (S_OK != Symbol->findInlineeLinesByAddr(Section, Offset, Length, &DiaEnumerator))
504  return nullptr;
505 
506  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
507 }
508 
509 std::unique_ptr<IPDBEnumLineNumbers>
511  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
512  if (S_OK != Symbol->findInlineeLinesByRVA(RVA, Length, &DiaEnumerator))
513  return nullptr;
514 
515  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
516 }
517 
518 std::unique_ptr<IPDBEnumLineNumbers>
519 DIARawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
520  CComPtr<IDiaEnumLineNumbers> DiaEnumerator;
521  if (S_OK != Symbol->findInlineeLinesByVA(VA, Length, &DiaEnumerator))
522  return nullptr;
523 
524  return llvm::make_unique<DIAEnumLineNumbers>(DiaEnumerator);
525 }
526 
528  bytes.clear();
529 
530  DWORD DataSize = 0;
531  Symbol->get_dataBytes(0, &DataSize, nullptr);
532  if (DataSize == 0)
533  return;
534 
535  bytes.resize(DataSize);
536  Symbol->get_dataBytes(DataSize, &DataSize, bytes.data());
537 }
538 
539 std::string
541  CComBSTR Result16;
542  if (S_OK != Symbol->get_undecoratedNameEx((DWORD)Flags, &Result16))
543  return std::string();
544 
545  const char *SrcBytes = reinterpret_cast<const char *>(Result16.m_str);
546  llvm::ArrayRef<char> SrcByteArray(SrcBytes, Result16.ByteLength());
547  std::string Result8;
548  if (!llvm::convertUTF16ToUTF8String(SrcByteArray, Result8))
549  return std::string();
550  return Result8;
551 }
552 
554  return PrivateGetDIAValue<DWORD, PDB_MemberAccess>(Symbol,
555  &IDiaSymbol::get_access);
556 }
557 
559  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressOffset);
560 }
561 
563  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressSection);
564 }
565 
567  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_age);
568 }
569 
571  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_arrayIndexTypeId);
572 }
573 
575  Version.Major = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndMajor);
576  Version.Minor = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndMinor);
577  Version.Build = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndBuild);
578  Version.QFE = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_backEndQFE);
579 }
580 
582  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseDataOffset);
583 }
584 
586  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseDataSlot);
587 }
588 
590  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_baseSymbolId);
591 }
592 
594  return PrivateGetDIAValue<DWORD, PDB_BuiltinType>(Symbol,
595  &IDiaSymbol::get_baseType);
596 }
597 
599  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_bitPosition);
600 }
601 
603  return PrivateGetDIAValue<DWORD, PDB_CallingConv>(
604  Symbol, &IDiaSymbol::get_callingConvention);
605 }
606 
608  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_classParentId);
609 }
610 
611 std::string DIARawSymbol::getCompilerName() const {
612  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_compilerName);
613 }
614 
616  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_count);
617 }
618 
620  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_countLiveRanges);
621 }
622 
624  Version.Major = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndMajor);
625  Version.Minor = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndMinor);
626  Version.Build = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndBuild);
627  Version.QFE = PrivateGetDIAValue(Symbol, &IDiaSymbol::get_frontEndQFE);
628 }
629 
631  return PrivateGetDIAValue<DWORD, PDB_Lang>(Symbol, &IDiaSymbol::get_language);
632 }
633 
635  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_lexicalParentId);
636 }
637 
638 std::string DIARawSymbol::getLibraryName() const {
639  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_libraryName);
640 }
641 
643  return PrivateGetDIAValue(Symbol,
644  &IDiaSymbol::get_liveRangeStartAddressOffset);
645 }
646 
648  return PrivateGetDIAValue(Symbol,
649  &IDiaSymbol::get_liveRangeStartAddressSection);
650 }
651 
653  return PrivateGetDIAValue(
654  Symbol, &IDiaSymbol::get_liveRangeStartRelativeVirtualAddress);
655 }
656 
658  return PrivateGetDIAValue<DWORD, codeview::RegisterId>(
659  Symbol, &IDiaSymbol::get_localBasePointerRegisterId);
660 }
661 
663  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_lowerBoundId);
664 }
665 
667  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_memorySpaceKind);
668 }
669 
670 std::string DIARawSymbol::getName() const {
671  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_name);
672 }
673 
675  return PrivateGetDIAValue(Symbol,
676  &IDiaSymbol::get_numberOfAcceleratorPointerTags);
677 }
678 
680  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfColumns);
681 }
682 
684  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfModifiers);
685 }
686 
688  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfRegisterIndices);
689 }
690 
692  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_numberOfRows);
693 }
694 
695 std::string DIARawSymbol::getObjectFileName() const {
696  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_objectFileName);
697 }
698 
700  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_oemId);
701 }
702 
704  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_oemSymbolId);
705 }
706 
708  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_offsetInUdt);
709 }
710 
712  return PrivateGetDIAValue<DWORD, PDB_Cpu>(Symbol, &IDiaSymbol::get_platform);
713 }
714 
716  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_rank);
717 }
718 
720  return PrivateGetDIAValue<DWORD, codeview::RegisterId>(
721  Symbol, &IDiaSymbol::get_registerId);
722 }
723 
725  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_registerType);
726 }
727 
729  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_relativeVirtualAddress);
730 }
731 
733  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_samplerSlot);
734 }
735 
737  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_signature);
738 }
739 
741  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sizeInUdt);
742 }
743 
745  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_slot);
746 }
747 
748 std::string DIARawSymbol::getSourceFileName() const {
749  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_sourceFileName);
750 }
751 
752 std::unique_ptr<IPDBLineNumber>
754  CComPtr<IDiaLineNumber> LineNumber;
755  if (FAILED(Symbol->getSrcLineOnTypeDefn(&LineNumber)) || !LineNumber)
756  return nullptr;
757 
758  return llvm::make_unique<DIALineNumber>(LineNumber);
759 }
760 
762  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_stride);
763 }
764 
766  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_subTypeId);
767 }
768 
769 std::string DIARawSymbol::getSymbolsFileName() const {
770  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_symbolsFileName);
771 }
772 
774  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_symIndexId);
775 }
776 
778  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetOffset);
779 }
780 
782  return PrivateGetDIAValue(Symbol,
783  &IDiaSymbol::get_targetRelativeVirtualAddress);
784 }
785 
787  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetVirtualAddress);
788 }
789 
791  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_targetSection);
792 }
793 
795  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_textureSlot);
796 }
797 
799  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_timeStamp);
800 }
801 
803  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_token);
804 }
805 
807  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_typeId);
808 }
809 
811  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_uavSlot);
812 }
813 
814 std::string DIARawSymbol::getUndecoratedName() const {
815  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_undecoratedName);
816 }
817 
819  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unmodifiedTypeId);
820 }
821 
823  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_upperBoundId);
824 }
825 
827  VARIANT Value;
828  Value.vt = VT_EMPTY;
829  if (S_OK != Symbol->get_value(&Value))
830  return Variant();
831 
832  return VariantFromVARIANT(Value);
833 }
834 
836  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseDispIndex);
837 }
838 
840  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseOffset);
841 }
842 
844  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualTableShapeId);
845 }
846 
847 std::unique_ptr<PDBSymbolTypeBuiltin>
849  CComPtr<IDiaSymbol> TableType;
850  if (FAILED(Symbol->get_virtualBaseTableType(&TableType)) || !TableType)
851  return nullptr;
852 
853  auto RawVT = llvm::make_unique<DIARawSymbol>(Session, TableType);
854  auto Pointer =
855  llvm::make_unique<PDBSymbolTypePointer>(Session, std::move(RawVT));
856  return unique_dyn_cast<PDBSymbolTypeBuiltin>(Pointer->getPointeeType());
857 }
858 
860  return PrivateGetDIAValue<DWORD, PDB_DataKind>(Symbol,
861  &IDiaSymbol::get_dataKind);
862 }
863 
865  return PrivateGetDIAValue<DWORD, PDB_SymType>(Symbol,
866  &IDiaSymbol::get_symTag);
867 }
868 
870  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_guid);
871 }
872 
873 int32_t DIARawSymbol::getOffset() const {
874  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_offset);
875 }
876 
878  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_thisAdjust);
879 }
880 
882  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBasePointerOffset);
883 }
884 
886  return PrivateGetDIAValue<DWORD, PDB_LocType>(Symbol,
887  &IDiaSymbol::get_locationType);
888 }
889 
891  return PrivateGetDIAValue<DWORD, PDB_Machine>(Symbol,
892  &IDiaSymbol::get_machineType);
893 }
894 
896  return PrivateGetDIAValue<DWORD, codeview::ThunkOrdinal>(
897  Symbol, &IDiaSymbol::get_thunkOrdinal);
898 }
899 
900 uint64_t DIARawSymbol::getLength() const {
901  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_length);
902 }
903 
905  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_liveRangeLength);
906 }
907 
909  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualAddress);
910 }
911 
913  return PrivateGetDIAValue<DWORD, PDB_UdtType>(Symbol,
914  &IDiaSymbol::get_udtKind);
915 }
916 
918  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_constructor);
919 }
920 
922  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_customCallingConvention);
923 }
924 
926  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_farReturn);
927 }
928 
929 bool DIARawSymbol::isCode() const {
930  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_code);
931 }
932 
934  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_compilerGenerated);
935 }
936 
938  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_constType);
939 }
940 
942  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_editAndContinueEnabled);
943 }
944 
946  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_function);
947 }
948 
950  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_addressTaken);
951 }
952 
954  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noStackOrdering);
955 }
956 
958  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasAlloca);
959 }
960 
962  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasAssignmentOperator);
963 }
964 
966  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCTypes);
967 }
968 
970  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasCastOperator);
971 }
972 
974  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasDebugInfo);
975 }
976 
977 bool DIARawSymbol::hasEH() const {
978  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasEH);
979 }
980 
981 bool DIARawSymbol::hasEHa() const {
982  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasEHa);
983 }
984 
986  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasInlAsm);
987 }
988 
990  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_inlSpec);
991 }
992 
994  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_interruptReturn);
995 }
996 
998  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_framePointerPresent);
999 }
1000 
1002  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasLongJump);
1003 }
1004 
1006  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasManagedCode);
1007 }
1008 
1010  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasNestedTypes);
1011 }
1012 
1014  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noInline);
1015 }
1016 
1018  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_noReturn);
1019 }
1020 
1022  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_optimizedCodeDebugInfo);
1023 }
1024 
1026  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_overloadedOperator);
1027 }
1028 
1029 bool DIARawSymbol::hasSEH() const {
1030  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSEH);
1031 }
1032 
1034  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSecurityChecks);
1035 }
1036 
1038  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_hasSetJump);
1039 }
1040 
1042  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_strictGSCheck);
1043 }
1044 
1046  return PrivateGetDIAValue(Symbol,
1047  &IDiaSymbol::get_isAcceleratorGroupSharedLocal);
1048 }
1049 
1051  return PrivateGetDIAValue(Symbol,
1052  &IDiaSymbol::get_isAcceleratorPointerTagLiveRange);
1053 }
1054 
1056  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isAcceleratorStubFunction);
1057 }
1058 
1060  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isAggregated);
1061 }
1062 
1064  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_intro);
1065 }
1066 
1068  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCVTCIL);
1069 }
1070 
1072  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isConstructorVirtualBase);
1073 }
1074 
1076  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isCxxReturnUdt);
1077 }
1078 
1080  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isDataAligned);
1081 }
1082 
1084  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isHLSLData);
1085 }
1086 
1088  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isHotpatchable);
1089 }
1090 
1092  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_indirectVirtualBaseClass);
1093 }
1094 
1096  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isInterfaceUdt);
1097 }
1098 
1100  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_intrinsic);
1101 }
1102 
1103 bool DIARawSymbol::isLTCG() const {
1104  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isLTCG);
1105 }
1106 
1108  return PrivateGetDIAValue(Symbol,
1109  &IDiaSymbol::get_isLocationControlFlowDependent);
1110 }
1111 
1113  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMSILNetmodule);
1114 }
1115 
1117  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMatrixRowMajor);
1118 }
1119 
1121  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_managed);
1122 }
1123 
1125  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_msil);
1126 }
1127 
1129  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isMultipleInheritance);
1130 }
1131 
1133  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isNaked);
1134 }
1135 
1137  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_nested);
1138 }
1139 
1141  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isOptimizedAway);
1142 }
1143 
1145  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_packed);
1146 }
1147 
1149  return PrivateGetDIAValue(Symbol,
1150  &IDiaSymbol::get_isPointerBasedOnSymbolValue);
1151 }
1152 
1154  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isPointerToDataMember);
1155 }
1156 
1158  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isPointerToMemberFunction);
1159 }
1160 
1162  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_pure);
1163 }
1164 
1166  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_RValueReference);
1167 }
1168 
1170  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isRefUdt);
1171 }
1172 
1174  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_reference);
1175 }
1176 
1178  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_restrictedType);
1179 }
1180 
1182  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isReturnValue);
1183 }
1184 
1186  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSafeBuffers);
1187 }
1188 
1190  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_scoped);
1191 }
1192 
1193 bool DIARawSymbol::isSdl() const {
1194  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSdl);
1195 }
1196 
1198  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSingleInheritance);
1199 }
1200 
1202  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isSplitted);
1203 }
1204 
1206  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isStatic);
1207 }
1208 
1210  // hasPrivateSymbols is the opposite of isStripped, but we expose
1211  // hasPrivateSymbols as a more intuitive interface.
1212  return !PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isStripped);
1213 }
1214 
1216  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unalignedType);
1217 }
1218 
1220  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_notReached);
1221 }
1222 
1224  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isValueUdt);
1225 }
1226 
1228  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtual);
1229 }
1230 
1232  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_virtualBaseClass);
1233 }
1234 
1236  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_isVirtualInheritance);
1237 }
1238 
1240  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_volatileType);
1241 }
1242 
1244  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_wasInlined);
1245 }
1246 
1247 std::string DIARawSymbol::getUnused() const {
1248  return PrivateGetDIAValue(Symbol, &IDiaSymbol::get_unused);
1249 }
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:234
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:97
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
union llvm::pdb::Variant::@192 Value
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
bool isScoped() const override
std::unique_ptr< IPDBLineNumber > getSrcLineOnTypeDefn() 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
ArgType PrivateGetDIAValue(IDiaSectionContrib *Section, HRESULT(__stdcall IDiaSectionContrib::*Method)(ArgType *))
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:285
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:179
uint32_t getRank() const override
PDB_MemberAccess getAccess() const override
uint32_t UInt32
Definition: PDBTypes.h:357
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:164
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:216
uint32_t getTargetRelativeVirtualAddress() const override
uint64_t UInt64
Definition: PDBTypes.h:358
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:861
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:144
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:356
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:259
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:46
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:346
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:895
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:308
void resize(size_type N)
Definition: SmallVector.h:352