LLVM  14.0.0git
DWARFDie.cpp
Go to the documentation of this file.
1 //===- DWARFDie.cpp -------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "llvm/ADT/None.h"
11 #include "llvm/ADT/Optional.h"
12 #include "llvm/ADT/SmallSet.h"
13 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Object/ObjectFile.h"
23 #include "llvm/Support/Format.h"
27 #include "llvm/Support/WithColor.h"
29 #include <algorithm>
30 #include <cassert>
31 #include <cinttypes>
32 #include <cstdint>
33 #include <string>
34 #include <utility>
35 
36 using namespace llvm;
37 using namespace dwarf;
38 using namespace object;
39 
41  OS << " (";
42  do {
44  assert(Shift < 64 && "undefined behavior");
45  uint64_t Bit = 1ULL << Shift;
46  auto PropName = ApplePropertyString(Bit);
47  if (!PropName.empty())
48  OS << PropName;
49  else
50  OS << format("DW_APPLE_PROPERTY_0x%" PRIx64, Bit);
51  if (!(Val ^= Bit))
52  break;
53  OS << ", ";
54  } while (true);
55  OS << ")";
56 }
57 
58 static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS,
59  const DWARFAddressRangesVector &Ranges,
60  unsigned AddressSize, unsigned Indent,
61  const DIDumpOptions &DumpOpts) {
62  if (!DumpOpts.ShowAddresses)
63  return;
64 
65  for (const DWARFAddressRange &R : Ranges) {
66  OS << '\n';
67  OS.indent(Indent);
68  R.dump(OS, AddressSize, DumpOpts, &Obj);
69  }
70 }
71 
72 static void dumpLocationList(raw_ostream &OS, const DWARFFormValue &FormValue,
73  DWARFUnit *U, unsigned Indent,
74  DIDumpOptions DumpOpts) {
76  "bad FORM for location list");
77  DWARFContext &Ctx = U->getContext();
78  const MCRegisterInfo *MRI = Ctx.getRegisterInfo();
79  uint64_t Offset = *FormValue.getAsSectionOffset();
80 
81  if (FormValue.getForm() == DW_FORM_loclistx) {
82  FormValue.dump(OS, DumpOpts);
83 
84  if (auto LoclistOffset = U->getLoclistOffset(Offset))
85  Offset = *LoclistOffset;
86  else
87  return;
88  }
90  Ctx.getDWARFObj(), U, DumpOpts,
91  Indent);
92 }
93 
94 static void dumpLocationExpr(raw_ostream &OS, const DWARFFormValue &FormValue,
95  DWARFUnit *U, unsigned Indent,
96  DIDumpOptions DumpOpts) {
99  "bad FORM for location expression");
100  DWARFContext &Ctx = U->getContext();
101  const MCRegisterInfo *MRI = Ctx.getRegisterInfo();
102  ArrayRef<uint8_t> Expr = *FormValue.getAsBlock();
103  DataExtractor Data(StringRef((const char *)Expr.data(), Expr.size()),
104  Ctx.isLittleEndian(), 0);
106  .print(OS, DumpOpts, MRI, U);
107 }
108 
110  dwarf::Attribute Attr = DW_AT_type) {
111  return D.getAttributeValueAsReferencedDie(Attr).resolveTypeUnitReference();
112 }
114  return D.getAttributeValueAsReferencedDie(F).resolveTypeUnitReference();
115 }
116 
117 namespace {
118 
119 // FIXME: We should have pretty printers per language. Currently we print
120 // everything as if it was C++ and fall back to the TAG type name.
121 struct DWARFTypePrinter {
122  raw_ostream &OS;
123  bool Word = true;
124  bool EndedWithTemplate = false;
125 
126  DWARFTypePrinter(raw_ostream &OS) : OS(OS) {}
127 
128  /// Dump the name encoded in the type tag.
129  void appendTypeTagName(dwarf::Tag T) {
130  StringRef TagStr = TagString(T);
131  static constexpr StringRef Prefix = "DW_TAG_";
132  static constexpr StringRef Suffix = "_type";
133  if (!TagStr.startswith(Prefix) || !TagStr.endswith(Suffix))
134  return;
135  OS << TagStr.substr(Prefix.size(),
136  TagStr.size() - (Prefix.size() + Suffix.size()))
137  << " ";
138  }
139 
140  void appendArrayType(const DWARFDie &D) {
141  for (const DWARFDie &C : D.children()) {
142  if (C.getTag() != DW_TAG_subrange_type)
143  continue;
145  Optional<uint64_t> Count;
147  Optional<unsigned> DefaultLB;
148  if (Optional<DWARFFormValue> L = C.find(DW_AT_lower_bound))
149  LB = L->getAsUnsignedConstant();
150  if (Optional<DWARFFormValue> CountV = C.find(DW_AT_count))
151  Count = CountV->getAsUnsignedConstant();
152  if (Optional<DWARFFormValue> UpperV = C.find(DW_AT_upper_bound))
153  UB = UpperV->getAsUnsignedConstant();
154  if (Optional<DWARFFormValue> LV =
155  D.getDwarfUnit()->getUnitDIE().find(DW_AT_language))
156  if (Optional<uint64_t> LC = LV->getAsUnsignedConstant())
157  if ((DefaultLB =
158  LanguageLowerBound(static_cast<dwarf::SourceLanguage>(*LC))))
159  if (LB && *LB == *DefaultLB)
160  LB = None;
161  if (!LB && !Count && !UB)
162  OS << "[]";
163  else if (!LB && (Count || UB) && DefaultLB)
164  OS << '[' << (Count ? *Count : *UB - *DefaultLB + 1) << ']';
165  else {
166  OS << "[[";
167  if (LB)
168  OS << *LB;
169  else
170  OS << '?';
171  OS << ", ";
172  if (Count)
173  if (LB)
174  OS << *LB + *Count;
175  else
176  OS << "? + " << *Count;
177  else if (UB)
178  OS << *UB + 1;
179  else
180  OS << '?';
181  OS << ")]";
182  }
183  }
184  EndedWithTemplate = false;
185  }
186 
187  DWARFDie skipQualifiers(DWARFDie D) {
188  while (D && (D.getTag() == DW_TAG_const_type ||
189  D.getTag() == DW_TAG_volatile_type))
191  return D;
192  }
193 
194  bool needsParens(DWARFDie D) {
195  D = skipQualifiers(D);
196  return D && (D.getTag() == DW_TAG_subroutine_type || D.getTag() == DW_TAG_array_type);
197  }
198 
199  void appendPointerLikeTypeBefore(DWARFDie D, DWARFDie Inner, StringRef Ptr) {
200  appendQualifiedNameBefore(Inner);
201  if (Word)
202  OS << ' ';
203  if (needsParens(Inner))
204  OS << '(';
205  OS << Ptr;
206  Word = false;
207  EndedWithTemplate = false;
208  }
209 
210  DWARFDie
211  appendUnqualifiedNameBefore(DWARFDie D,
212  std::string *OriginalFullName = nullptr) {
213  Word = true;
214  if (!D) {
215  OS << "void";
216  return DWARFDie();
217  }
218  DWARFDie InnerDIE;
219  auto Inner = [&] { return InnerDIE = resolveReferencedType(D); };
220  const dwarf::Tag T = D.getTag();
221  switch (T) {
222  case DW_TAG_pointer_type: {
223  appendPointerLikeTypeBefore(D, Inner(), "*");
224  break;
225  }
226  case DW_TAG_subroutine_type: {
227  appendQualifiedNameBefore(Inner());
228  if (Word) {
229  OS << ' ';
230  }
231  Word = false;
232  break;
233  }
234  case DW_TAG_array_type: {
235  appendQualifiedNameBefore(Inner());
236  break;
237  }
238  case DW_TAG_reference_type:
239  appendPointerLikeTypeBefore(D, Inner(), "&");
240  break;
241  case DW_TAG_rvalue_reference_type:
242  appendPointerLikeTypeBefore(D, Inner(), "&&");
243  break;
244  case DW_TAG_ptr_to_member_type: {
245  appendQualifiedNameBefore(Inner());
246  if (needsParens(InnerDIE))
247  OS << '(';
248  else if (Word)
249  OS << ' ';
250  if (DWARFDie Cont = resolveReferencedType(D, DW_AT_containing_type)) {
251  appendQualifiedName(Cont);
252  OS << "::";
253  }
254  OS << "*";
255  Word = false;
256  break;
257  }
258  case DW_TAG_const_type:
259  case DW_TAG_volatile_type:
260  appendConstVolatileQualifierBefore(D);
261  break;
262  case DW_TAG_namespace: {
263  if (const char *Name = dwarf::toString(D.find(DW_AT_name), nullptr))
264  OS << Name;
265  else
266  OS << "(anonymous namespace)";
267  break;
268  }
269  case DW_TAG_unspecified_type: {
270  StringRef TypeName = D.getShortName();
271  if (TypeName == "decltype(nullptr)")
272  TypeName = "std::nullptr_t";
273  Word = true;
274  OS << TypeName;
275  EndedWithTemplate = false;
276  break;
277  }
278  /*
279  case DW_TAG_structure_type:
280  case DW_TAG_class_type:
281  case DW_TAG_enumeration_type:
282  case DW_TAG_base_type:
283  */
284  default: {
285  const char *NamePtr = dwarf::toString(D.find(DW_AT_name), nullptr);
286  if (!NamePtr) {
287  appendTypeTagName(D.getTag());
288  return DWARFDie();
289  }
290  Word = true;
291  StringRef Name = NamePtr;
292  static constexpr StringRef MangledPrefix = "_STN";
293  if (Name.startswith(MangledPrefix)) {
294  Name = Name.drop_front(MangledPrefix.size());
295  auto Separator = Name.find('|');
296  assert(Separator != StringRef::npos);
297  StringRef BaseName = Name.substr(0, Separator);
298  StringRef TemplateArgs = Name.substr(Separator + 1);
299  if (OriginalFullName)
300  *OriginalFullName = (BaseName + TemplateArgs).str();
301  Name = BaseName;
302  } else
303  EndedWithTemplate = Name.endswith(">");
304  OS << Name;
305  // This check would be insufficient for operator overloads like
306  // "operator>>" - but for now Clang doesn't try to simplify them, so this
307  // is OK. Add more nuanced operator overload handling here if/when needed.
308  if (Name.endswith(">"))
309  break;
310  if (!appendTemplateParameters(D))
311  break;
312 
313  if (EndedWithTemplate)
314  OS << ' ';
315  OS << '>';
316  EndedWithTemplate = true;
317  Word = true;
318  break;
319  }
320  }
321  return InnerDIE;
322  }
323 
324  void appendUnqualifiedNameAfter(DWARFDie D, DWARFDie Inner,
325  bool SkipFirstParamIfArtificial = false) {
326  if (!D)
327  return;
328  switch (D.getTag()) {
329  case DW_TAG_subroutine_type: {
330  appendSubroutineNameAfter(D, Inner, SkipFirstParamIfArtificial, false,
331  false);
332  break;
333  }
334  case DW_TAG_array_type: {
335  appendArrayType(D);
336  break;
337  }
338  case DW_TAG_const_type:
339  case DW_TAG_volatile_type:
340  appendConstVolatileQualifierAfter(D);
341  break;
342  case DW_TAG_ptr_to_member_type:
343  case DW_TAG_reference_type:
344  case DW_TAG_rvalue_reference_type:
345  case DW_TAG_pointer_type: {
346  if (needsParens(Inner))
347  OS << ')';
348  appendUnqualifiedNameAfter(Inner, resolveReferencedType(Inner),
349  /*SkipFirstParamIfArtificial=*/D.getTag() ==
350  DW_TAG_ptr_to_member_type);
351  break;
352  }
353  /*
354  case DW_TAG_structure_type:
355  case DW_TAG_class_type:
356  case DW_TAG_enumeration_type:
357  case DW_TAG_base_type:
358  case DW_TAG_namespace:
359  */
360  default:
361  break;
362  }
363  }
364 
365  void appendQualifiedName(DWARFDie D) {
366  if (D)
367  appendScopes(D.getParent());
368  appendUnqualifiedName(D);
369  }
370  DWARFDie appendQualifiedNameBefore(DWARFDie D) {
371  if (D)
372  appendScopes(D.getParent());
373  return appendUnqualifiedNameBefore(D);
374  }
375  bool appendTemplateParameters(DWARFDie D, bool *FirstParameter = nullptr) {
376  bool FirstParameterValue = true;
377  bool IsTemplate = false;
378  if (!FirstParameter)
379  FirstParameter = &FirstParameterValue;
380  for (const DWARFDie &C : D) {
381  auto Sep = [&] {
382  if (*FirstParameter)
383  OS << '<';
384  else
385  OS << ", ";
386  IsTemplate = true;
387  EndedWithTemplate = false;
388  *FirstParameter = false;
389  };
390  if (C.getTag() == dwarf::DW_TAG_GNU_template_parameter_pack) {
391  IsTemplate = true;
392  appendTemplateParameters(C, FirstParameter);
393  }
394  if (C.getTag() == dwarf::DW_TAG_template_value_parameter) {
395  DWARFDie T = resolveReferencedType(C);
396  Sep();
397  if (T.getTag() == DW_TAG_enumeration_type) {
398  auto V = C.find(DW_AT_const_value);
399  bool FoundEnumerator = false;
400  for (const DWARFDie &Enumerator : T) {
401  auto EV = Enumerator.find(DW_AT_const_value);
402  if (V && EV &&
403  V->getAsSignedConstant() == EV->getAsSignedConstant()) {
404  if (T.find(DW_AT_enum_class)) {
405  appendQualifiedName(T);
406  OS << "::";
407  } else
408  appendScopes(T.getParent());
409  OS << Enumerator.getShortName();
410  FoundEnumerator = true;
411  break;
412  }
413  }
414  if (FoundEnumerator)
415  continue;
416  OS << '(';
417  appendQualifiedName(T);
418  OS << ')';
419  OS << to_string(*V->getAsSignedConstant());
420  continue;
421  }
422  // /Maybe/ we could do pointer type parameters, looking for the
423  // symbol in the ELF symbol table to get back to the variable...
424  // but probably not worth it.
425  if (T.getTag() == DW_TAG_pointer_type)
426  continue;
427  const char *RawName = dwarf::toString(T.find(DW_AT_name), nullptr);
428  assert(RawName);
429  StringRef Name = RawName;
430  auto V = C.find(DW_AT_const_value);
431  bool IsQualifiedChar = false;
432  if (Name == "bool") {
433  OS << (*V->getAsUnsignedConstant() ? "true" : "false");
434  } else if (Name == "short") {
435  OS << "(short)";
436  OS << to_string(*V->getAsSignedConstant());
437  } else if (Name == "unsigned short") {
438  OS << "(unsigned short)";
439  OS << to_string(*V->getAsSignedConstant());
440  } else if (Name == "int")
441  OS << to_string(*V->getAsSignedConstant());
442  else if (Name == "long") {
443  OS << to_string(*V->getAsSignedConstant());
444  OS << "L";
445  } else if (Name == "long long") {
446  OS << to_string(*V->getAsSignedConstant());
447  OS << "LL";
448  } else if (Name == "unsigned int") {
449  OS << to_string(*V->getAsUnsignedConstant());
450  OS << "U";
451  } else if (Name == "unsigned long") {
452  OS << to_string(*V->getAsUnsignedConstant());
453  OS << "UL";
454  } else if (Name == "unsigned long long") {
455  OS << to_string(*V->getAsUnsignedConstant());
456  OS << "ULL";
457  } else if (Name == "char" ||
458  (IsQualifiedChar =
459  (Name == "unsigned char" || Name == "signed char"))) {
460  // FIXME: check T's DW_AT_type to see if it's signed or not (since
461  // char signedness is implementation defined).
462  auto Val = *V->getAsSignedConstant();
463  // Copied/hacked up from Clang's CharacterLiteral::print - incomplete
464  // (doesn't actually support different character types/widths, sign
465  // handling's not done, and doesn't correctly test if a character is
466  // printable or needs to use a numeric escape sequence instead)
467  if (IsQualifiedChar) {
468  OS << '(';
469  OS << Name;
470  OS << ')';
471  }
472  switch (Val) {
473  case '\\':
474  OS << "'\\\\'";
475  break;
476  case '\'':
477  OS << "'\\''";
478  break;
479  case '\a':
480  // TODO: K&R: the meaning of '\\a' is different in traditional C
481  OS << "'\\a'";
482  break;
483  case '\b':
484  OS << "'\\b'";
485  break;
486  case '\f':
487  OS << "'\\f'";
488  break;
489  case '\n':
490  OS << "'\\n'";
491  break;
492  case '\r':
493  OS << "'\\r'";
494  break;
495  case '\t':
496  OS << "'\\t'";
497  break;
498  case '\v':
499  OS << "'\\v'";
500  break;
501  default:
502  if ((Val & ~0xFFu) == ~0xFFu)
503  Val &= 0xFFu;
504  if (Val < 127 && Val >= 32) {
505  OS << "'";
506  OS << (char)Val;
507  OS << "'";
508  } else if (Val < 256)
509  OS << to_string(llvm::format("'\\x%02x'", Val));
510  else if (Val <= 0xFFFF)
511  OS << to_string(llvm::format("'\\u%04x'", Val));
512  else
513  OS << to_string(llvm::format("'\\U%08x'", Val));
514  }
515  }
516  continue;
517  }
518  if (C.getTag() == dwarf::DW_TAG_GNU_template_template_param) {
519  const char *RawName =
520  dwarf::toString(C.find(DW_AT_GNU_template_name), nullptr);
521  assert(RawName);
522  StringRef Name = RawName;
523  Sep();
524  OS << Name;
525  continue;
526  }
527  if (C.getTag() != dwarf::DW_TAG_template_type_parameter)
528  continue;
529  auto TypeAttr = C.find(DW_AT_type);
530  Sep();
531  appendQualifiedName(TypeAttr ? resolveReferencedType(C, *TypeAttr)
532  : DWARFDie());
533  }
534  if (IsTemplate && *FirstParameter && FirstParameter == &FirstParameterValue)
535  OS << '<';
536  return IsTemplate;
537  }
538  void decomposeConstVolatile(DWARFDie &N, DWARFDie &T, DWARFDie &C,
539  DWARFDie &V) {
540  (N.getTag() == DW_TAG_const_type ? C : V) = N;
542  if (T) {
543  auto Tag = T.getTag();
544  if (Tag == DW_TAG_const_type) {
545  C = T;
547  } else if (Tag == DW_TAG_volatile_type) {
548  V = T;
550  }
551  }
552  }
553  void appendConstVolatileQualifierAfter(DWARFDie N) {
554  DWARFDie C;
555  DWARFDie V;
556  DWARFDie T;
557  decomposeConstVolatile(N, T, C, V);
558  if (T && T.getTag() == DW_TAG_subroutine_type)
559  appendSubroutineNameAfter(T, resolveReferencedType(T), false, C.isValid(),
560  V.isValid());
561  else
562  appendUnqualifiedNameAfter(T, resolveReferencedType(T));
563  }
564  void appendConstVolatileQualifierBefore(DWARFDie N) {
565  DWARFDie C;
566  DWARFDie V;
567  DWARFDie T;
568  decomposeConstVolatile(N, T, C, V);
569  bool Subroutine = T && T.getTag() == DW_TAG_subroutine_type;
570  DWARFDie A = T;
571  while (A && A.getTag() == DW_TAG_array_type)
573  bool Leading =
574  (!A || (A.getTag() != DW_TAG_pointer_type &&
575  A.getTag() != llvm::dwarf::DW_TAG_ptr_to_member_type)) &&
576  !Subroutine;
577  if (Leading) {
578  if (C)
579  OS << "const ";
580  if (V)
581  OS << "volatile ";
582  }
583  appendQualifiedNameBefore(T);
584  if (!Leading && !Subroutine) {
585  Word = true;
586  if (C)
587  OS << "const";
588  if (V) {
589  if (C)
590  OS << ' ';
591  OS << "volatile";
592  }
593  }
594  }
595 
596  /// Recursively append the DIE type name when applicable.
597  void appendUnqualifiedName(DWARFDie D,
598  std::string *OriginalFullName = nullptr) {
599  // FIXME: We should have pretty printers per language. Currently we print
600  // everything as if it was C++ and fall back to the TAG type name.
601  DWARFDie Inner = appendUnqualifiedNameBefore(D, OriginalFullName);
602  appendUnqualifiedNameAfter(D, Inner);
603  }
604 
605  void appendSubroutineNameAfter(DWARFDie D, DWARFDie Inner,
606  bool SkipFirstParamIfArtificial, bool Const,
607  bool Volatile) {
608  DWARFDie FirstParamIfArtificial;
609  OS << '(';
610  EndedWithTemplate = false;
611  bool First = true;
612  bool RealFirst = true;
613  for (DWARFDie P : D) {
614  if (P.getTag() != DW_TAG_formal_parameter &&
615  P.getTag() != DW_TAG_unspecified_parameters)
616  return;
618  if (SkipFirstParamIfArtificial && RealFirst && P.find(DW_AT_artificial)) {
619  FirstParamIfArtificial = T;
620  RealFirst = false;
621  continue;
622  }
623  if (!First) {
624  OS << ", ";
625  }
626  First = false;
627  if (P.getTag() == DW_TAG_unspecified_parameters)
628  OS << "...";
629  else
630  appendQualifiedName(T);
631  }
632  EndedWithTemplate = false;
633  OS << ')';
634  if (FirstParamIfArtificial) {
635  if (DWARFDie P = FirstParamIfArtificial) {
636  if (P.getTag() == DW_TAG_pointer_type) {
637  DWARFDie C;
638  DWARFDie V;
639  auto CVStep = [&](DWARFDie CV) {
640  if (DWARFDie U = resolveReferencedType(CV)) {
641  if (U.getTag() == DW_TAG_const_type)
642  return C = U;
643  if (U.getTag() == DW_TAG_volatile_type)
644  return V = U;
645  }
646  return DWARFDie();
647  };
648  if (DWARFDie CV = CVStep(P)) {
649  CVStep(CV);
650  }
651  if (C)
652  OS << " const";
653  if (V)
654  OS << " volatile";
655  }
656  }
657  } else {
658  if (Const)
659  OS << " const";
660  if (Volatile)
661  OS << " volatile";
662  }
663  if (D.find(DW_AT_reference))
664  OS << " &";
665  if (D.find(DW_AT_rvalue_reference))
666  OS << " &&";
667  appendUnqualifiedNameAfter(Inner, resolveReferencedType(Inner));
668  }
669  void appendScopes(DWARFDie D) {
670  if (D.getTag() == DW_TAG_compile_unit)
671  return;
672  if (D.getTag() == DW_TAG_type_unit)
673  return;
674  if (D.getTag() == DW_TAG_skeleton_unit)
675  return;
676  if (D.getTag() == DW_TAG_subprogram)
677  return;
678  if (D.getTag() == DW_TAG_lexical_block)
679  return;
680  D = D.resolveTypeUnitReference();
681  if (DWARFDie P = D.getParent())
682  appendScopes(P);
683  appendUnqualifiedName(D);
684  OS << "::";
685  }
686 };
687 } // anonymous namespace
688 
689 static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
690  const DWARFAttribute &AttrValue, unsigned Indent,
691  DIDumpOptions DumpOpts) {
692  if (!Die.isValid())
693  return;
694  const char BaseIndent[] = " ";
695  OS << BaseIndent;
696  OS.indent(Indent + 2);
697  dwarf::Attribute Attr = AttrValue.Attr;
698  WithColor(OS, HighlightColor::Attribute) << formatv("{0}", Attr);
699 
700  dwarf::Form Form = AttrValue.Value.getForm();
701  if (DumpOpts.Verbose || DumpOpts.ShowForm)
702  OS << formatv(" [{0}]", Form);
703 
704  DWARFUnit *U = Die.getDwarfUnit();
705  const DWARFFormValue &FormValue = AttrValue.Value;
706 
707  OS << "\t(";
708 
709  StringRef Name;
710  std::string File;
711  auto Color = HighlightColor::Enumerator;
712  if (Attr == DW_AT_decl_file || Attr == DW_AT_call_file) {
713  Color = HighlightColor::String;
714  if (const auto *LT = U->getContext().getLineTableForUnit(U))
715  if (LT->getFileNameByIndex(
716  FormValue.getAsUnsignedConstant().getValue(),
717  U->getCompilationDir(),
719  File = '"' + File + '"';
720  Name = File;
721  }
722  } else if (Optional<uint64_t> Val = FormValue.getAsUnsignedConstant())
723  Name = AttributeValueString(Attr, *Val);
724 
725  if (!Name.empty())
726  WithColor(OS, Color) << Name;
727  else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line)
728  OS << *FormValue.getAsUnsignedConstant();
729  else if (Attr == DW_AT_low_pc &&
730  (FormValue.getAsAddress() ==
732  if (DumpOpts.Verbose) {
733  FormValue.dump(OS, DumpOpts);
734  OS << " (";
735  }
736  OS << "dead code";
737  if (DumpOpts.Verbose)
738  OS << ')';
739  } else if (Attr == DW_AT_high_pc && !DumpOpts.ShowForm && !DumpOpts.Verbose &&
740  FormValue.getAsUnsignedConstant()) {
741  if (DumpOpts.ShowAddresses) {
742  // Print the actual address rather than the offset.
743  uint64_t LowPC, HighPC, Index;
744  if (Die.getLowAndHighPC(LowPC, HighPC, Index))
746  else
747  FormValue.dump(OS, DumpOpts);
748  }
749  } else if (DWARFAttribute::mayHaveLocationList(Attr) &&
751  dumpLocationList(OS, FormValue, U, sizeof(BaseIndent) + Indent + 4,
752  DumpOpts);
753  else if (FormValue.isFormClass(DWARFFormValue::FC_Exprloc) ||
756  dumpLocationExpr(OS, FormValue, U, sizeof(BaseIndent) + Indent + 4,
757  DumpOpts);
758  else
759  FormValue.dump(OS, DumpOpts);
760 
761  std::string Space = DumpOpts.ShowAddresses ? " " : "";
762 
763  // We have dumped the attribute raw value. For some attributes
764  // having both the raw value and the pretty-printed value is
765  // interesting. These attributes are handled below.
766  if (Attr == DW_AT_specification || Attr == DW_AT_abstract_origin) {
767  if (const char *Name =
770  OS << Space << "\"" << Name << '\"';
771  } else if (Attr == DW_AT_type) {
772  DWARFDie D = resolveReferencedType(Die, FormValue);
773  if (D && !D.isNULL()) {
774  OS << Space << "\"";
776  OS << '"';
777  }
778  } else if (Attr == DW_AT_APPLE_property_attribute) {
779  if (Optional<uint64_t> OptVal = FormValue.getAsUnsignedConstant())
780  dumpApplePropertyAttribute(OS, *OptVal);
781  } else if (Attr == DW_AT_ranges) {
782  const DWARFObject &Obj = Die.getDwarfUnit()->getContext().getDWARFObj();
783  // For DW_FORM_rnglistx we need to dump the offset separately, since
784  // we have only dumped the index so far.
785  if (FormValue.getForm() == DW_FORM_rnglistx)
786  if (auto RangeListOffset =
787  U->getRnglistOffset(*FormValue.getAsSectionOffset())) {
789  dwarf::DW_FORM_sec_offset, *RangeListOffset);
790  FV.dump(OS, DumpOpts);
791  }
792  if (auto RangesOrError = Die.getAddressRanges())
793  dumpRanges(Obj, OS, RangesOrError.get(), U->getAddressByteSize(),
794  sizeof(BaseIndent) + Indent + 4, DumpOpts);
795  else
797  errc::invalid_argument, "decoding address ranges: %s",
798  toString(RangesOrError.takeError()).c_str()));
799  }
800 
801  OS << ")\n";
802 }
803 
805  std::string *OriginalFullName) const {
806  const char *NamePtr = getShortName();
807  if (!NamePtr)
808  return;
809  if (getTag() == DW_TAG_GNU_template_parameter_pack)
810  return;
811  dumpTypeUnqualifiedName(*this, OS, OriginalFullName);
812 }
813 
814 bool DWARFDie::isSubprogramDIE() const { return getTag() == DW_TAG_subprogram; }
815 
817  auto Tag = getTag();
818  return Tag == DW_TAG_subprogram || Tag == DW_TAG_inlined_subroutine;
819 }
820 
822  if (!isValid())
823  return None;
824  auto AbbrevDecl = getAbbreviationDeclarationPtr();
825  if (AbbrevDecl)
826  return AbbrevDecl->getAttributeValue(getOffset(), Attr, *U);
827  return None;
828 }
829 
832  if (!isValid())
833  return None;
834  auto AbbrevDecl = getAbbreviationDeclarationPtr();
835  if (AbbrevDecl) {
836  for (auto Attr : Attrs) {
837  if (auto Value = AbbrevDecl->getAttributeValue(getOffset(), Attr, *U))
838  return Value;
839  }
840  }
841  return None;
842 }
843 
846  SmallVector<DWARFDie, 3> Worklist;
847  Worklist.push_back(*this);
848 
849  // Keep track if DIEs already seen to prevent infinite recursion.
850  // Empirically we rarely see a depth of more than 3 when dealing with valid
851  // DWARF. This corresponds to following the DW_AT_abstract_origin and
852  // DW_AT_specification just once.
854  Seen.insert(*this);
855 
856  while (!Worklist.empty()) {
857  DWARFDie Die = Worklist.pop_back_val();
858 
859  if (!Die.isValid())
860  continue;
861 
862  if (auto Value = Die.find(Attrs))
863  return Value;
864 
865  if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
866  if (Seen.insert(D).second)
867  Worklist.push_back(D);
868 
869  if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_specification))
870  if (Seen.insert(D).second)
871  Worklist.push_back(D);
872  }
873 
874  return None;
875 }
876 
877 DWARFDie
879  if (Optional<DWARFFormValue> F = find(Attr))
880  return getAttributeValueAsReferencedDie(*F);
881  return DWARFDie();
882 }
883 
884 DWARFDie
886  DWARFDie Result;
887  if (auto SpecRef = V.getAsRelativeReference()) {
888  if (SpecRef->Unit)
889  Result = SpecRef->Unit->getDIEForOffset(SpecRef->Unit->getOffset() +
890  SpecRef->Offset);
891  else if (auto SpecUnit =
892  U->getUnitVector().getUnitForOffset(SpecRef->Offset))
893  Result = SpecUnit->getDIEForOffset(SpecRef->Offset);
894  }
895  return Result;
896 }
897 
899  if (auto Attr = find(DW_AT_signature)) {
900  if (Optional<uint64_t> Sig = Attr->getAsReferenceUVal()) {
902  U->getVersion(), *Sig, U->isDWOUnit()))
903  return TU->getDIEForOffset(TU->getTypeOffset() + TU->getOffset());
904  }
905  }
906  return *this;
907 }
908 
910  return toSectionOffset(find({DW_AT_rnglists_base, DW_AT_GNU_ranges_base}));
911 }
912 
914  return toSectionOffset(find(DW_AT_loclists_base));
915 }
916 
918  uint64_t Tombstone = dwarf::computeTombstoneAddress(U->getAddressByteSize());
919  if (LowPC == Tombstone)
920  return None;
921  if (auto FormValue = find(DW_AT_high_pc)) {
922  if (auto Address = FormValue->getAsAddress()) {
923  // High PC is an address.
924  return Address;
925  }
926  if (auto Offset = FormValue->getAsUnsignedConstant()) {
927  // High PC is an offset from LowPC.
928  return LowPC + *Offset;
929  }
930  }
931  return None;
932 }
933 
935  uint64_t &SectionIndex) const {
936  auto F = find(DW_AT_low_pc);
937  auto LowPcAddr = toSectionedAddress(F);
938  if (!LowPcAddr)
939  return false;
940  if (auto HighPcAddr = getHighPC(LowPcAddr->Address)) {
941  LowPC = LowPcAddr->Address;
942  HighPC = *HighPcAddr;
943  SectionIndex = LowPcAddr->SectionIndex;
944  return true;
945  }
946  return false;
947 }
948 
950  if (isNULL())
951  return DWARFAddressRangesVector();
952  // Single range specified by low/high PC.
953  uint64_t LowPC, HighPC, Index;
954  if (getLowAndHighPC(LowPC, HighPC, Index))
955  return DWARFAddressRangesVector{{LowPC, HighPC, Index}};
956 
957  Optional<DWARFFormValue> Value = find(DW_AT_ranges);
958  if (Value) {
959  if (Value->getForm() == DW_FORM_rnglistx)
960  return U->findRnglistFromIndex(*Value->getAsSectionOffset());
961  return U->findRnglistFromOffset(*Value->getAsSectionOffset());
962  }
963  return DWARFAddressRangesVector();
964 }
965 
967  auto RangesOrError = getAddressRanges();
968  if (!RangesOrError) {
969  llvm::consumeError(RangesOrError.takeError());
970  return false;
971  }
972 
973  for (const auto &R : RangesOrError.get())
974  if (R.LowPC <= Address && Address < R.HighPC)
975  return true;
976  return false;
977 }
978 
981  Optional<DWARFFormValue> Location = find(Attr);
982  if (!Location)
983  return createStringError(inconvertibleErrorCode(), "No %s",
984  dwarf::AttributeString(Attr).data());
985 
986  if (Optional<uint64_t> Off = Location->getAsSectionOffset()) {
987  uint64_t Offset = *Off;
988 
989  if (Location->getForm() == DW_FORM_loclistx) {
990  if (auto LoclistOffset = U->getLoclistOffset(Offset))
991  Offset = *LoclistOffset;
992  else
994  "Loclist table not found");
995  }
996  return U->findLoclistFromOffset(Offset);
997  }
998 
999  if (Optional<ArrayRef<uint8_t>> Expr = Location->getAsBlock()) {
1001  DWARFLocationExpression{None, to_vector<4>(*Expr)}};
1002  }
1003 
1004  return createStringError(
1005  inconvertibleErrorCode(), "Unsupported %s encoding: %s",
1006  dwarf::AttributeString(Attr).data(),
1007  dwarf::FormEncodingString(Location->getForm()).data());
1008 }
1009 
1011  if (!isSubroutineDIE())
1012  return nullptr;
1013  return getName(Kind);
1014 }
1015 
1016 const char *DWARFDie::getName(DINameKind Kind) const {
1017  if (!isValid() || Kind == DINameKind::None)
1018  return nullptr;
1019  // Try to get mangled name only if it was asked for.
1020  if (Kind == DINameKind::LinkageName) {
1021  if (auto Name = getLinkageName())
1022  return Name;
1023  }
1024  return getShortName();
1025 }
1026 
1027 const char *DWARFDie::getShortName() const {
1028  if (!isValid())
1029  return nullptr;
1030 
1031  return dwarf::toString(findRecursively(dwarf::DW_AT_name), nullptr);
1032 }
1033 
1034 const char *DWARFDie::getLinkageName() const {
1035  if (!isValid())
1036  return nullptr;
1037 
1038  return dwarf::toString(findRecursively({dwarf::DW_AT_MIPS_linkage_name,
1039  dwarf::DW_AT_linkage_name}),
1040  nullptr);
1041 }
1042 
1044  return toUnsigned(findRecursively(DW_AT_decl_line), 0);
1045 }
1046 
1047 std::string
1049  if (auto FormValue = findRecursively(DW_AT_decl_file))
1050  if (auto OptString = FormValue->getAsFile(Kind))
1051  return *OptString;
1052  return {};
1053 }
1054 
1055 void DWARFDie::getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
1056  uint32_t &CallColumn,
1057  uint32_t &CallDiscriminator) const {
1058  CallFile = toUnsigned(find(DW_AT_call_file), 0);
1059  CallLine = toUnsigned(find(DW_AT_call_line), 0);
1060  CallColumn = toUnsigned(find(DW_AT_call_column), 0);
1061  CallDiscriminator = toUnsigned(find(DW_AT_GNU_discriminator), 0);
1062 }
1063 
1064 /// Helper to dump a DIE with all of its parents, but no siblings.
1065 static unsigned dumpParentChain(DWARFDie Die, raw_ostream &OS, unsigned Indent,
1066  DIDumpOptions DumpOpts, unsigned Depth = 0) {
1067  if (!Die)
1068  return Indent;
1069  if (DumpOpts.ParentRecurseDepth > 0 && Depth >= DumpOpts.ParentRecurseDepth)
1070  return Indent;
1071  Indent = dumpParentChain(Die.getParent(), OS, Indent, DumpOpts, Depth + 1);
1072  Die.dump(OS, Indent, DumpOpts);
1073  return Indent + 2;
1074 }
1075 
1076 void DWARFDie::dump(raw_ostream &OS, unsigned Indent,
1077  DIDumpOptions DumpOpts) const {
1078  if (!isValid())
1079  return;
1080  DWARFDataExtractor debug_info_data = U->getDebugInfoExtractor();
1081  const uint64_t Offset = getOffset();
1082  uint64_t offset = Offset;
1083  if (DumpOpts.ShowParents) {
1084  DIDumpOptions ParentDumpOpts = DumpOpts;
1085  ParentDumpOpts.ShowParents = false;
1086  ParentDumpOpts.ShowChildren = false;
1087  Indent = dumpParentChain(getParent(), OS, Indent, ParentDumpOpts);
1088  }
1089 
1090  if (debug_info_data.isValidOffset(offset)) {
1091  uint32_t abbrCode = debug_info_data.getULEB128(&offset);
1092  if (DumpOpts.ShowAddresses)
1094  << format("\n0x%8.8" PRIx64 ": ", Offset);
1095 
1096  if (abbrCode) {
1097  auto AbbrevDecl = getAbbreviationDeclarationPtr();
1098  if (AbbrevDecl) {
1099  WithColor(OS, HighlightColor::Tag).get().indent(Indent)
1100  << formatv("{0}", getTag());
1101  if (DumpOpts.Verbose) {
1102  OS << format(" [%u] %c", abbrCode,
1103  AbbrevDecl->hasChildren() ? '*' : ' ');
1104  if (Optional<uint32_t> ParentIdx = Die->getParentIdx())
1105  OS << format(" (0x%8.8" PRIx64 ")",
1106  U->getDIEAtIndex(*ParentIdx).getOffset());
1107  }
1108  OS << '\n';
1109 
1110  // Dump all data in the DIE for the attributes.
1111  for (const DWARFAttribute &AttrValue : attributes())
1112  dumpAttribute(OS, *this, AttrValue, Indent, DumpOpts);
1113 
1114  if (DumpOpts.ShowChildren && DumpOpts.ChildRecurseDepth > 0) {
1115  DWARFDie Child = getFirstChild();
1116  DumpOpts.ChildRecurseDepth--;
1117  DIDumpOptions ChildDumpOpts = DumpOpts;
1118  ChildDumpOpts.ShowParents = false;
1119  while (Child) {
1120  Child.dump(OS, Indent + 2, ChildDumpOpts);
1121  Child = Child.getSibling();
1122  }
1123  }
1124  } else {
1125  OS << "Abbreviation code not found in 'debug_abbrev' class for code: "
1126  << abbrCode << '\n';
1127  }
1128  } else {
1129  OS.indent(Indent) << "NULL\n";
1130  }
1131  }
1132 }
1133 
1135 
1137  if (isValid())
1138  return U->getParent(Die);
1139  return DWARFDie();
1140 }
1141 
1143  if (isValid())
1144  return U->getSibling(Die);
1145  return DWARFDie();
1146 }
1147 
1149  if (isValid())
1150  return U->getPreviousSibling(Die);
1151  return DWARFDie();
1152 }
1153 
1155  if (isValid())
1156  return U->getFirstChild(Die);
1157  return DWARFDie();
1158 }
1159 
1161  if (isValid())
1162  return U->getLastChild(Die);
1163  return DWARFDie();
1164 }
1165 
1167  return make_range(attribute_iterator(*this, false),
1168  attribute_iterator(*this, true));
1169 }
1170 
1172  : Die(D), Index(0) {
1173  auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
1174  assert(AbbrDecl && "Must have abbreviation declaration");
1175  if (End) {
1176  // This is the end iterator so we set the index to the attribute count.
1177  Index = AbbrDecl->getNumAttributes();
1178  } else {
1179  // This is the begin iterator so we extract the value for this->Index.
1180  AttrValue.Offset = D.getOffset() + AbbrDecl->getCodeByteSize();
1181  updateForIndex(*AbbrDecl, 0);
1182  }
1183 }
1184 
1185 void DWARFDie::attribute_iterator::updateForIndex(
1186  const DWARFAbbreviationDeclaration &AbbrDecl, uint32_t I) {
1187  Index = I;
1188  // AbbrDecl must be valid before calling this function.
1189  auto NumAttrs = AbbrDecl.getNumAttributes();
1190  if (Index < NumAttrs) {
1191  AttrValue.Attr = AbbrDecl.getAttrByIndex(Index);
1192  // Add the previous byte size of any previous attribute value.
1193  AttrValue.Offset += AttrValue.ByteSize;
1194  uint64_t ParseOffset = AttrValue.Offset;
1195  if (AbbrDecl.getAttrIsImplicitConstByIndex(Index))
1196  AttrValue.Value = DWARFFormValue::createFromSValue(
1197  AbbrDecl.getFormByIndex(Index),
1199  else {
1200  auto U = Die.getDwarfUnit();
1201  assert(U && "Die must have valid DWARF unit");
1202  AttrValue.Value = DWARFFormValue::createFromUnit(
1203  AbbrDecl.getFormByIndex(Index), U, &ParseOffset);
1204  }
1205  AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
1206  } else {
1207  assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
1208  AttrValue = {};
1209  }
1210 }
1211 
1213  if (auto AbbrDecl = Die.getAbbreviationDeclarationPtr())
1214  updateForIndex(*AbbrDecl, Index + 1);
1215  return *this;
1216 }
1217 
1219  switch(Attr) {
1220  case DW_AT_location:
1221  case DW_AT_string_length:
1222  case DW_AT_return_addr:
1223  case DW_AT_data_member_location:
1224  case DW_AT_frame_base:
1225  case DW_AT_static_link:
1226  case DW_AT_segment:
1227  case DW_AT_use_location:
1228  case DW_AT_vtable_elem_location:
1229  return true;
1230  default:
1231  return false;
1232  }
1233 }
1234 
1236  switch (Attr) {
1237  // From the DWARF v5 specification.
1238  case DW_AT_location:
1239  case DW_AT_byte_size:
1240  case DW_AT_bit_offset:
1241  case DW_AT_bit_size:
1242  case DW_AT_string_length:
1243  case DW_AT_lower_bound:
1244  case DW_AT_return_addr:
1245  case DW_AT_bit_stride:
1246  case DW_AT_upper_bound:
1247  case DW_AT_count:
1248  case DW_AT_data_member_location:
1249  case DW_AT_frame_base:
1250  case DW_AT_segment:
1251  case DW_AT_static_link:
1252  case DW_AT_use_location:
1253  case DW_AT_vtable_elem_location:
1254  case DW_AT_allocated:
1255  case DW_AT_associated:
1256  case DW_AT_data_location:
1257  case DW_AT_byte_stride:
1258  case DW_AT_rank:
1259  case DW_AT_call_value:
1260  case DW_AT_call_origin:
1261  case DW_AT_call_target:
1262  case DW_AT_call_target_clobbered:
1263  case DW_AT_call_data_location:
1264  case DW_AT_call_data_value:
1265  // Extensions.
1266  case DW_AT_GNU_call_site_value:
1267  case DW_AT_GNU_call_site_target:
1268  return true;
1269  default:
1270  return false;
1271  }
1272 }
1273 
1274 namespace llvm {
1275 
1277  DWARFTypePrinter(OS).appendQualifiedName(DIE);
1278 }
1279 
1281  std::string *OriginalFullName) {
1282  DWARFTypePrinter(OS).appendUnqualifiedName(DIE, OriginalFullName);
1283 }
1284 
1285 } // namespace llvm
llvm::DWARFLocationExpressionsVector
std::vector< DWARFLocationExpression > DWARFLocationExpressionsVector
Represents a set of absolute location expressions.
Definition: DWARFLocationExpression.h:45
DWARFFormValue.h
llvm::errc::invalid_argument
@ invalid_argument
llvm::StringRef::startswith
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:285
llvm::DWARFContext::getLineTableForUnit
const DWARFDebugLine::LineTable * getLineTableForUnit(DWARFUnit *U)
Get a pointer to a parsed line table corresponding to a compile unit.
Definition: DWARFContext.cpp:957
Attrs
Function Attrs
Definition: README_ALTIVEC.txt:215
getName
static StringRef getName(Value *V)
Definition: ProvenanceAnalysisEvaluator.cpp:42
llvm::DIDumpOptions::ShowForm
bool ShowForm
Definition: DIContext.h:189
llvm::DWARFDie::isValid
bool isValid() const
Definition: DWARFDie.h:51
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:510
MathExtras.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::DWARFDie::getPreviousSibling
DWARFDie getPreviousSibling() const
Get the previous sibling of this DIE object.
Definition: DWARFDie.cpp:1148
llvm::DWARFDie::getRangesBaseAttribute
Optional< uint64_t > getRangesBaseAttribute() const
Extract the range base attribute from this DIE as absolute section offset.
Definition: DWARFDie.cpp:909
it
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions main should enable SSE DAZ mode and other fast SSE modes Think about doing i64 math in SSE regs on x86 This testcase should have no SSE instructions in it
Definition: README-SSE.txt:81
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
Optional.h
dumpAttribute
static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die, const DWARFAttribute &AttrValue, unsigned Indent, DIDumpOptions DumpOpts)
Definition: DWARFDie.cpp:689
llvm::DWARFAttribute::Value
DWARFFormValue Value
The form and value for this attribute.
Definition: DWARFAttribute.h:32
print
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Definition: ArchiveWriter.cpp:148
llvm::DWARFDie::getLinkageName
const char * getLinkageName() const
Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if nece...
Definition: DWARFDie.cpp:1034
llvm::DWARFUnit::getRnglistOffset
Optional< uint64_t > getRnglistOffset(uint32_t Index)
Return a rangelist's offset based on an index.
Definition: DWARFUnit.cpp:1013
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:164
see
The object format emitted by the WebAssembly backed is documented see the home and packaging for producing WebAssembly applications that can run in browsers and other environments wasi sdk provides a more minimal C C SDK based on llvm and a libc based on for producing WebAssemmbly applictions that use the WASI ABI Rust provides WebAssembly support integrated into Cargo There are two main which provides a relatively minimal environment that has an emphasis on being native wasm32 unknown which uses Emscripten internally and provides standard C C filesystem GL and SDL bindings For more see
Definition: README.txt:41
llvm::DWARFDie::dump
LLVM_DUMP_METHOD void dump() const
Convenience zero-argument overload for debugging.
Definition: DWARFDie.cpp:1134
llvm::StringRef::endswith
LLVM_NODISCARD bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
Definition: StringRef.h:296
T
llvm::DWARFDie::resolveTypeUnitReference
DWARFDie resolveTypeUnitReference() const
Definition: DWARFDie.cpp:898
llvm::DWARFAttribute::Attr
dwarf::Attribute Attr
The attribute enumeration of this attribute.
Definition: DWARFAttribute.h:30
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::DWARFAbbreviationDeclaration::getFormByIndex
dwarf::Form getFormByIndex(uint32_t idx) const
Definition: DWARFAbbreviationDeclaration.h:100
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:631
llvm::DWARFDie::getShortName
const char * getShortName() const
Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necess...
Definition: DWARFDie.cpp:1027
llvm::StringRef::npos
static constexpr size_t npos
Definition: StringRef.h:59
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1177
llvm::dwarf::Form
Form
Definition: Dwarf.h:131
llvm::DWARFFormValue::getAsAddress
Optional< uint64_t > getAsAddress() const
Definition: DWARFFormValue.cpp:665
DWARFContext.h
llvm::dwarf::toSectionedAddress
Optional< object::SectionedAddress > toSectionedAddress(const Optional< DWARFFormValue > &V)
Definition: DWARFFormValue.h:295
llvm::DWARFDie::getAbbreviationDeclarationPtr
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
Definition: DWARFDie.h:59
llvm::DWARFFormValue::createFromUValue
static DWARFFormValue createFromUValue(dwarf::Form F, uint64_t V)
Definition: DWARFFormValue.cpp:84
to
Should compile to
Definition: README.txt:449
llvm::DWARFAbbreviationDeclaration::getAttrByIndex
dwarf::Attribute getAttrByIndex(uint32_t idx) const
Definition: DWARFAbbreviationDeclaration.h:109
llvm::DWARFFormValue::getAsUnsignedConstant
Optional< uint64_t > getAsUnsignedConstant() const
Definition: DWARFFormValue.cpp:724
llvm::Depth
@ Depth
Definition: SIMachineScheduler.h:36
dumpLocationList
static void dumpLocationList(raw_ostream &OS, const DWARFFormValue &FormValue, DWARFUnit *U, unsigned Indent, DIDumpOptions DumpOpts)
Definition: DWARFDie.cpp:72
Shift
bool Shift
Definition: README.txt:468
llvm::WithColor::get
raw_ostream & get()
Definition: WithColor.h:80
llvm::DWARFContext
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition: DWARFContext.h:53
llvm::DWARFFormValue::FC_Exprloc
@ FC_Exprloc
Definition: DWARFFormValue.h:38
llvm::DWARFLocationExpression
Represents a single DWARF expression, whose value is location-dependent.
Definition: DWARFLocationExpression.h:22
llvm::SmallSet
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:134
llvm::WithColor
An RAII object that temporarily switches an output stream to a specific color.
Definition: WithColor.h:53
llvm::Optional< uint64_t >
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:80
llvm::DWARFDie::addressRangeContainsAddress
bool addressRangeContainsAddress(const uint64_t Address) const
Definition: DWARFDie.cpp:966
llvm::DIE
A structured debug information entry.
Definition: DIE.h:739
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:894
llvm::DWARFExpression::print
void print(raw_ostream &OS, DIDumpOptions DumpOpts, const MCRegisterInfo *RegInfo, DWARFUnit *U, bool IsEH=false) const
Definition: DWARFExpression.cpp:325
attributes
Deduce and propagate attributes
Definition: Attributor.cpp:3111
llvm::dump
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
Definition: SparseBitVector.h:876
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Definition: DWARFDebugInfoEntry.h:72
llvm::SmallVectorImpl::pop_back_val
LLVM_NODISCARD T pop_back_val()
Definition: SmallVector.h:644
llvm::DWARFUnit::getFormParams
const dwarf::FormParams & getFormParams() const
Definition: DWARFUnit.h:282
llvm::DWARFDataExtractor
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
Definition: DWARFDataExtractor.h:21
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:104
llvm::DINameKind::LinkageName
@ LinkageName
Format.h
llvm::dwarf::FormParams::Format
DwarfFormat Format
Definition: Dwarf.h:651
dumpLocationExpr
static void dumpLocationExpr(raw_ostream &OS, const DWARFFormValue &FormValue, DWARFUnit *U, unsigned Indent, DIDumpOptions DumpOpts)
Definition: DWARFDie.cpp:94
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1045
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::getOffset
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
Definition: RuntimeDyld.cpp:174
llvm::dwarf::Attribute
Attribute
Attributes.
Definition: Dwarf.h:124
llvm::ArrayRef::data
const T * data() const
Definition: ArrayRef.h:160
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::DWARFUnit::getLoclistOffset
Optional< uint64_t > getLoclistOffset(uint32_t Index)
Definition: DWARFUnit.cpp:1024
llvm::AArch64CC::LT
@ LT
Definition: AArch64BaseInfo.h:266
llvm::StringRef::substr
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Definition: StringRef.h:610
llvm::DWARFAttribute::Offset
uint64_t Offset
The debug info/types offset for this attribute.
Definition: DWARFAttribute.h:26
llvm::DWARFDie::getLastChild
DWARFDie getLastChild() const
Get the last child of this DIE object.
Definition: DWARFDie.cpp:1160
llvm::DataExtractor::getULEB128
uint64_t getULEB128(uint64_t *offset_ptr, llvm::Error *Err=nullptr) const
Extract a unsigned LEB128 value from *offset_ptr.
Definition: DataExtractor.cpp:221
llvm::formatv
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
Definition: FormatVariadic.h:250
llvm::DIDumpOptions::ShowAddresses
bool ShowAddresses
Definition: DIContext.h:186
llvm::DWARFAttribute
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value.
Definition: DWARFAttribute.h:24
llvm::DWARFFormValue::createFromSValue
static DWARFFormValue createFromSValue(dwarf::Form F, int64_t V)
Definition: DWARFFormValue.cpp:80
llvm::HighlightColor::Tag
@ Tag
dumpRanges
static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS, const DWARFAddressRangesVector &Ranges, unsigned AddressSize, unsigned Indent, const DIDumpOptions &DumpOpts)
Definition: DWARFDie.cpp:58
DWARFDebugRangeList.h
llvm::DIDumpOptions::Verbose
bool Verbose
Definition: DIContext.h:191
llvm::DINameKind
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
Definition: DIContext.h:131
dumpApplePropertyAttribute
static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val)
Definition: DWARFDie.cpp:40
llvm::dwarf::computeTombstoneAddress
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
Definition: Dwarf.h:775
llvm::dwarf::AttributeValueString
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
Definition: Dwarf.cpp:639
llvm::DWARFDie::isSubroutineDIE
bool isSubroutineDIE() const
Returns true if DIE represents a subprogram or an inlined subroutine.
Definition: DWARFDie.cpp:816
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::HighlightColor::Enumerator
@ Enumerator
llvm::ARM_PROC::A
@ A
Definition: ARMBaseInfo.h:34
llvm::dwarf::getTag
unsigned getTag(StringRef TagString)
Definition: Dwarf.cpp:32
llvm::DWARFFormValue::FC_SectionOffset
@ FC_SectionOffset
Definition: DWARFFormValue.h:37
llvm::DWARFFormValue::dump
void dump(raw_ostream &OS, DIDumpOptions DumpOpts=DIDumpOptions()) const
Definition: DWARFFormValue.cpp:405
llvm::dwarf::LanguageLowerBound
Optional< unsigned > LanguageLowerBound(SourceLanguage L)
Definition: Dwarf.cpp:368
llvm::DWARFLocationTable::dumpLocationList
bool dumpLocationList(uint64_t *Offset, raw_ostream &OS, Optional< object::SectionedAddress > BaseAddr, const MCRegisterInfo *MRI, const DWARFObject &Obj, DWARFUnit *U, DIDumpOptions DumpOpts, unsigned Indent) const
Dump the location list at the given Offset.
Definition: DWARFDebugLoc.cpp:119
llvm::DIDumpOptions::ShowChildren
bool ShowChildren
Definition: DIContext.h:187
llvm::DWARFFormValue::getAsSectionOffset
Optional< uint64_t > getAsSectionOffset() const
Definition: DWARFFormValue.cpp:718
DWARFDie.h
llvm::dwarf::Index
Index
Definition: Dwarf.h:467
llvm::DWARFDie::getCallerFrame
void getCallerFrame(uint32_t &CallFile, uint32_t &CallLine, uint32_t &CallColumn, uint32_t &CallDiscriminator) const
Retrieves values of DW_AT_call_file, DW_AT_call_line and DW_AT_call_column from DIE (or zeroes if the...
Definition: DWARFDie.cpp:1055
First
into llvm powi allowing the code generator to produce balanced multiplication trees First
Definition: README.txt:54
llvm::DIDumpOptions::ChildRecurseDepth
unsigned ChildRecurseDepth
Definition: DIContext.h:182
llvm::DWARFDie::getDeclFile
std::string getDeclFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
Definition: DWARFDie.cpp:1048
llvm::dwarf::toSectionOffset
Optional< uint64_t > toSectionOffset(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an section offset.
Definition: DWARFFormValue.h:316
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::DWARFObject
Definition: DWARFObject.h:25
llvm::DWARFFormValue
Definition: DWARFFormValue.h:26
llvm::DWARFDie::attribute_iterator
Definition: DWARFDie.h:294
FormatVariadic.h
llvm::None
const NoneType None
Definition: None.h:23
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::dwarf::FormEncodingString
StringRef FormEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:105
llvm::DWARFDie::dump
void dump(raw_ostream &OS, unsigned indent=0, DIDumpOptions DumpOpts=DIDumpOptions()) const
Dump the DIE and all of its attributes to the supplied stream.
Definition: DWARFDie.cpp:1076
llvm::DWARFFormValue::getAsRelativeReference
Optional< UnitOffset > getAsRelativeReference() const
Definition: DWARFFormValue.cpp:697
llvm::DIDumpOptions::ShowParents
bool ShowParents
Definition: DIContext.h:188
getLinkageName
static std::string getLinkageName(GlobalValue::LinkageTypes LT)
Definition: AsmWriter.cpp:3107
llvm::DWARFContext::getTypeUnitForHash
DWARFTypeUnit * getTypeUnitForHash(uint16_t Version, uint64_t Hash, bool IsDWO)
Definition: DWARFContext.cpp:696
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::DWARFDie::getDeclLine
uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
Definition: DWARFDie.cpp:1043
llvm::find
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1669
llvm::DWARFDie::getAddressRanges
Expected< DWARFAddressRangesVector > getAddressRanges() const
Get the address ranges for this DIE.
Definition: DWARFDie.cpp:949
s
multiplies can be turned into SHL s
Definition: README.txt:370
llvm::dumpTypeUnqualifiedName
void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS, std::string *OriginalFullName=nullptr)
Definition: DWARFDie.cpp:1280
I
#define I(x, y, z)
Definition: MD5.cpp:58
DWARFUnit.h
llvm::DWARFDie::find
Optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
Definition: DWARFDie.cpp:821
llvm::DILineInfoSpecifier::FileLineInfoKind
FileLineInfoKind
Definition: DIContext.h:136
llvm::DWARFExpression
Definition: DWARFExpression.h:25
llvm::HighlightColor::Address
@ Address
llvm::DataExtractor::isValidOffset
bool isValidOffset(uint64_t offset) const
Test the validity of offset.
Definition: DataExtractor.h:665
DWARFAbbreviationDeclaration.h
llvm::DWARFFormValue::FC_Block
@ FC_Block
Definition: DWARFFormValue.h:31
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ObjectFile.h
llvm::DWARFDie::findRecursively
Optional< DWARFFormValue > findRecursively(ArrayRef< dwarf::Attribute > Attrs) const
Extract the first value of any attribute in Attrs from this DIE and recurse into any DW_AT_specificat...
Definition: DWARFDie.cpp:845
llvm::DWARFDie::getLowAndHighPC
bool getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC, uint64_t &SectionIndex) const
Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
Definition: DWARFDie.cpp:934
llvm::irsymtab::storage::Word
support::ulittle32_t Word
Definition: IRSymtab.h:52
llvm::dwarf::toString
Optional< const char * > toString(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
Definition: DWARFFormValue.h:175
llvm::dwarf::SourceLanguage
SourceLanguage
Definition: Dwarf.h:200
llvm::DWARFDie::getLocations
Expected< DWARFLocationExpressionsVector > getLocations(dwarf::Attribute Attr) const
Definition: DWARFDie.cpp:980
llvm::DWARFUnit::getCompilationDir
const char * getCompilationDir()
Definition: DWARFUnit.cpp:372
llvm::ArrayRef< uint8_t >
llvm::DWARFAbbreviationDeclaration::getNumAttributes
size_t getNumAttributes() const
Definition: DWARFAbbreviationDeclaration.h:105
llvm::DWARFContext::isLittleEndian
bool isLittleEndian() const
Definition: DWARFContext.h:379
None.h
llvm::DWARFFormValue::dumpAddress
void dumpAddress(raw_ostream &OS, uint64_t Address) const
llvm::HighlightColor::String
@ String
llvm::countTrailingZeros
unsigned countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1.
Definition: MathExtras.h:156
llvm::DWARFAbbreviationDeclaration::getAttrIsImplicitConstByIndex
bool getAttrIsImplicitConstByIndex(uint32_t idx) const
Definition: DWARFAbbreviationDeclaration.h:114
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
Dwarf.h
llvm::DWARFUnit::getContext
DWARFContext & getContext() const
Definition: DWARFUnit.h:279
llvm::DWARFDie::getDwarfUnit
DWARFUnit * getDwarfUnit() const
Definition: DWARFDie.h:54
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:870
uint32_t
llvm::DWARFDie::getName
const char * getName(DINameKind Kind) const
Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary.
Definition: DWARFDie.cpp:1016
llvm::DWARFDie::getLocBaseAttribute
Optional< uint64_t > getLocBaseAttribute() const
Definition: DWARFDie.cpp:913
llvm::dwarf::ApplePropertyString
StringRef ApplePropertyString(unsigned)
Definition: Dwarf.cpp:565
llvm::DWARFDie::getSibling
DWARFDie getSibling() const
Get the sibling of this DIE object.
Definition: DWARFDie.cpp:1142
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
llvm::SmallSet::insert
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Definition: SmallSet.h:180
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath
@ AbsoluteFilePath
llvm::DWARFAttribute::mayHaveLocationExpr
static bool mayHaveLocationExpr(dwarf::Attribute Attr)
Identifies DWARF attributes that may contain a reference to a DWARF expression.
Definition: DWARFDie.cpp:1235
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::DWARFDie::attribute_iterator::operator++
attribute_iterator & operator++()
Definition: DWARFDie.cpp:1212
llvm::StringRef::size
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:156
llvm::HighlightColor::Attribute
@ Attribute
WithColor.h
llvm::DWARFDie::getParent
DWARFDie getParent() const
Get the parent of this DIE object.
Definition: DWARFDie.cpp:1136
llvm::DWARFUnit::getAddressByteSize
uint8_t getAddressByteSize() const
Definition: DWARFUnit.h:286
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1241
llvm::DWARFAddressRangesVector
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Definition: DWARFAddressRange.h:85
llvm::DWARFTypeUnit
Definition: DWARFTypeUnit.h:25
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::dumpTypeQualifiedName
void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS)
Definition: DWARFDie.cpp:1276
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition: Error.cpp:77
llvm::DWARFContext::getRegisterInfo
const MCRegisterInfo * getRegisterInfo() const
Definition: DWARFContext.h:411
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::TypeName
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
Definition: AMDGPUMetadata.h:170
llvm::DWARFAbbreviationDeclaration
Definition: DWARFAbbreviationDeclaration.h:27
llvm::DWARFUnit
Definition: DWARFUnit.h:203
llvm::DWARFFormValue::getAsBlock
Optional< ArrayRef< uint8_t > > getAsBlock() const
Definition: DWARFFormValue.cpp:750
DataExtractor.h
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
DWARFExpression.h
llvm::DWARFDie::getFullName
void getFullName(raw_string_ostream &, std::string *OriginalFullName=nullptr) const
Definition: DWARFDie.cpp:804
llvm::DWARFAbbreviationDeclaration::getAttrImplicitConstValueByIndex
int64_t getAttrImplicitConstValueByIndex(uint32_t idx) const
Definition: DWARFAbbreviationDeclaration.h:119
llvm::dwarf::toUnsigned
Optional< uint64_t > toUnsigned(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
Definition: DWARFFormValue.h:223
llvm::DWARFDie::getAttributeValueAsReferencedDie
DWARFDie getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE as the referenced DIE.
Definition: DWARFDie.cpp:878
FormatAdapters.h
isValid
static bool isValid(const char C)
Returns true if C is a valid mangled character: <0-9a-zA-Z_>.
Definition: RustDemangle.cpp:217
llvm::DataExtractor
Definition: DataExtractor.h:41
llvm::DWARFUnit::getBaseAddress
llvm::Optional< object::SectionedAddress > getBaseAddress()
Definition: DWARFUnit.cpp:874
llvm::DWARFDie::attributes
iterator_range< attribute_iterator > attributes() const
Get an iterator range to all attributes in the current DIE only.
Definition: DWARFDie.cpp:1166
llvm::DINameKind::None
@ None
llvm::raw_ostream::indent
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
Definition: raw_ostream.cpp:497
llvm::DWARFFormValue::isFormClass
bool isFormClass(FormClass FC) const
Definition: DWARFFormValue.cpp:212
N
#define N
llvm::DWARFContext::getDWARFObj
const DWARFObject & getDWARFObj() const
Definition: DWARFContext.h:132
llvm::to_string
std::string to_string(const T &Value)
Definition: ScopedPrinter.h:87
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:163
llvm::DWARFFormValue::getForm
dwarf::Form getForm() const
Definition: DWARFFormValue.h:77
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::tgtok::Bit
@ Bit
Definition: TGLexer.h:50
llvm::DWARFDie::attribute_iterator::attribute_iterator
attribute_iterator()=delete
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:148
llvm::DWARFDie::getHighPC
Optional< uint64_t > getHighPC(uint64_t LowPC) const
Get the DW_AT_high_pc attribute value as an address.
Definition: DWARFDie.cpp:917
llvm::DWARFAttribute::mayHaveLocationList
static bool mayHaveLocationList(dwarf::Attribute Attr)
Identify DWARF attributes that may contain a pointer to a location list.
Definition: DWARFDie.cpp:1218
resolveReferencedType
static DWARFDie resolveReferencedType(DWARFDie D, dwarf::Attribute Attr=DW_AT_type)
Definition: DWARFDie.cpp:109
llvm::DWARFFormValue::createFromUnit
static DWARFFormValue createFromUnit(dwarf::Form F, const DWARFUnit *Unit, uint64_t *OffsetPtr)
Definition: DWARFFormValue.cpp:100
llvm::DWARFDie
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition: DWARFDie.h:43
llvm::DWARFAddressRange
Definition: DWARFAddressRange.h:22
llvm::DWARFDie::isSubprogramDIE
bool isSubprogramDIE() const
Returns true if DIE represents a subprogram (not inlined).
Definition: DWARFDie.cpp:814
TemplateArgs
Definition: ItaniumDemangle.h:1341
llvm::dwarf::TagString
StringRef TagString(unsigned Tag)
Definition: Dwarf.cpp:21
raw_ostream.h
llvm::DWARFUnit::getLocationTable
const DWARFLocationTable & getLocationTable()
Definition: DWARFUnit.h:342
dumpParentChain
static unsigned dumpParentChain(DWARFDie Die, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, unsigned Depth=0)
Helper to dump a DIE with all of its parents, but no siblings.
Definition: DWARFDie.cpp:1065
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:205
llvm::dwarf::AttributeString
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
llvm::DWARFDie::getFirstChild
DWARFDie getFirstChild() const
Get the first child of this DIE object.
Definition: DWARFDie.cpp:1154
llvm::DIDumpOptions::ParentRecurseDepth
unsigned ParentRecurseDepth
Definition: DIContext.h:183
llvm::Optional::getValue
constexpr const T & getValue() const LLVM_LVALUE_FUNCTION
Definition: Optional.h:282
llvm::DWARFDie::getSubroutineName
const char * getSubroutineName(DINameKind Kind) const
If a DIE represents a subprogram (or inlined subroutine), returns its mangled name (or short name,...
Definition: DWARFDie.cpp:1010
SmallSet.h
llvm::DIDumpOptions
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:180
llvm::DIDumpOptions::RecoverableErrorHandler
std::function< void(Error)> RecoverableErrorHandler
Definition: DIContext.h:212