30#define DEBUG_TYPE "DWARFReader"
33 CurrentScope =
nullptr;
34 CurrentSymbol =
nullptr;
35 CurrentType =
nullptr;
36 CurrentRanges.clear();
38 if (!
options().getPrintSymbols()) {
43 case dwarf::DW_TAG_formal_parameter:
44 case dwarf::DW_TAG_unspecified_parameters:
45 case dwarf::DW_TAG_member:
46 case dwarf::DW_TAG_variable:
47 case dwarf::DW_TAG_inheritance:
48 case dwarf::DW_TAG_constant:
49 case dwarf::DW_TAG_call_site_parameter:
50 case dwarf::DW_TAG_GNU_call_site_parameter:
59 case dwarf::DW_TAG_base_type:
60 CurrentType = createType();
61 CurrentType->setIsBase();
62 if (
options().getAttributeBase())
63 CurrentType->setIncludeInPrint();
65 case dwarf::DW_TAG_const_type:
66 CurrentType = createType();
67 CurrentType->setIsConst();
70 case dwarf::DW_TAG_enumerator:
71 CurrentType = createTypeEnumerator();
73 case dwarf::DW_TAG_imported_declaration:
74 CurrentType = createTypeImport();
75 CurrentType->setIsImportDeclaration();
77 case dwarf::DW_TAG_imported_module:
78 CurrentType = createTypeImport();
79 CurrentType->setIsImportModule();
81 case dwarf::DW_TAG_pointer_type:
82 CurrentType = createType();
83 CurrentType->setIsPointer();
86 case dwarf::DW_TAG_ptr_to_member_type:
87 CurrentType = createType();
88 CurrentType->setIsPointerMember();
91 case dwarf::DW_TAG_reference_type:
92 CurrentType = createType();
93 CurrentType->setIsReference();
96 case dwarf::DW_TAG_restrict_type:
97 CurrentType = createType();
98 CurrentType->setIsRestrict();
99 CurrentType->
setName(
"restrict");
101 case dwarf::DW_TAG_rvalue_reference_type:
102 CurrentType = createType();
103 CurrentType->setIsRvalueReference();
106 case dwarf::DW_TAG_subrange_type:
107 CurrentType = createTypeSubrange();
109 case dwarf::DW_TAG_template_value_parameter:
110 CurrentType = createTypeParam();
111 CurrentType->setIsTemplateValueParam();
113 case dwarf::DW_TAG_template_type_parameter:
114 CurrentType = createTypeParam();
115 CurrentType->setIsTemplateTypeParam();
117 case dwarf::DW_TAG_GNU_template_template_param:
118 CurrentType = createTypeParam();
119 CurrentType->setIsTemplateTemplateParam();
121 case dwarf::DW_TAG_typedef:
122 CurrentType = createTypeDefinition();
124 case dwarf::DW_TAG_unspecified_type:
125 CurrentType = createType();
126 CurrentType->setIsUnspecified();
128 case dwarf::DW_TAG_volatile_type:
129 CurrentType = createType();
130 CurrentType->setIsVolatile();
131 CurrentType->
setName(
"volatile");
135 case dwarf::DW_TAG_formal_parameter:
136 CurrentSymbol = createSymbol();
137 CurrentSymbol->setIsParameter();
138 return CurrentSymbol;
139 case dwarf::DW_TAG_unspecified_parameters:
140 CurrentSymbol = createSymbol();
141 CurrentSymbol->setIsUnspecified();
143 return CurrentSymbol;
144 case dwarf::DW_TAG_member:
145 CurrentSymbol = createSymbol();
146 CurrentSymbol->setIsMember();
147 return CurrentSymbol;
148 case dwarf::DW_TAG_variable:
149 CurrentSymbol = createSymbol();
150 CurrentSymbol->setIsVariable();
151 return CurrentSymbol;
152 case dwarf::DW_TAG_inheritance:
153 CurrentSymbol = createSymbol();
154 CurrentSymbol->setIsInheritance();
155 return CurrentSymbol;
156 case dwarf::DW_TAG_call_site_parameter:
157 case dwarf::DW_TAG_GNU_call_site_parameter:
158 CurrentSymbol = createSymbol();
159 CurrentSymbol->setIsCallSiteParameter();
160 return CurrentSymbol;
161 case dwarf::DW_TAG_constant:
162 CurrentSymbol = createSymbol();
163 CurrentSymbol->setIsConstant();
164 return CurrentSymbol;
167 case dwarf::DW_TAG_catch_block:
168 CurrentScope = createScope();
169 CurrentScope->setIsCatchBlock();
171 case dwarf::DW_TAG_lexical_block:
172 CurrentScope = createScope();
173 CurrentScope->setIsLexicalBlock();
175 case dwarf::DW_TAG_try_block:
176 CurrentScope = createScope();
177 CurrentScope->setIsTryBlock();
179 case dwarf::DW_TAG_compile_unit:
180 case dwarf::DW_TAG_skeleton_unit:
181 CurrentScope = createScopeCompileUnit();
184 case dwarf::DW_TAG_inlined_subroutine:
185 CurrentScope = createScopeFunctionInlined();
187 case dwarf::DW_TAG_namespace:
188 CurrentScope = createScopeNamespace();
190 case dwarf::DW_TAG_template_alias:
191 CurrentScope = createScopeAlias();
193 case dwarf::DW_TAG_array_type:
194 CurrentScope = createScopeArray();
196 case dwarf::DW_TAG_call_site:
197 case dwarf::DW_TAG_GNU_call_site:
198 CurrentScope = createScopeFunction();
199 CurrentScope->setIsCallSite();
201 case dwarf::DW_TAG_entry_point:
202 CurrentScope = createScopeFunction();
203 CurrentScope->setIsEntryPoint();
205 case dwarf::DW_TAG_subprogram:
206 CurrentScope = createScopeFunction();
207 CurrentScope->setIsSubprogram();
209 case dwarf::DW_TAG_subroutine_type:
210 CurrentScope = createScopeFunctionType();
212 case dwarf::DW_TAG_label:
213 CurrentScope = createScopeFunction();
214 CurrentScope->setIsLabel();
216 case dwarf::DW_TAG_class_type:
217 CurrentScope = createScopeAggregate();
218 CurrentScope->setIsClass();
220 case dwarf::DW_TAG_structure_type:
221 CurrentScope = createScopeAggregate();
222 CurrentScope->setIsStructure();
224 case dwarf::DW_TAG_union_type:
225 CurrentScope = createScopeAggregate();
226 CurrentScope->setIsUnion();
228 case dwarf::DW_TAG_enumeration_type:
229 CurrentScope = createScopeEnumeration();
231 case dwarf::DW_TAG_GNU_formal_parameter_pack:
232 CurrentScope = createScopeFormalPack();
234 case dwarf::DW_TAG_GNU_template_parameter_pack:
235 CurrentScope = createScopeTemplatePack();
246void LVDWARFReader::processOneAttribute(
const DWARFDie &Die,
249 uint64_t OffsetOnEntry = *OffsetPtr;
256 auto GetAsUnsignedConstant = [&]() -> int64_t {
265 auto GetBoundValue = [](
const DWARFFormValue &FormValue) -> int64_t {
267 case dwarf::DW_FORM_ref_addr:
268 case dwarf::DW_FORM_ref1:
269 case dwarf::DW_FORM_ref2:
270 case dwarf::DW_FORM_ref4:
271 case dwarf::DW_FORM_ref8:
272 case dwarf::DW_FORM_ref_udata:
273 case dwarf::DW_FORM_ref_sig8:
275 case dwarf::DW_FORM_data1:
276 case dwarf::DW_FORM_flag:
277 case dwarf::DW_FORM_data2:
278 case dwarf::DW_FORM_data4:
279 case dwarf::DW_FORM_data8:
280 case dwarf::DW_FORM_udata:
281 case dwarf::DW_FORM_ref_sup4:
282 case dwarf::DW_FORM_ref_sup8:
284 case dwarf::DW_FORM_sdata:
296 switch (AttrSpec.
Attr) {
297 case dwarf::DW_AT_accessibility:
300 case dwarf::DW_AT_artificial:
301 CurrentElement->setIsArtificial();
303 case dwarf::DW_AT_bit_size:
306 case dwarf::DW_AT_call_file:
309 case dwarf::DW_AT_call_line:
311 ? GetAsUnsignedConstant() + 1
312 : GetAsUnsignedConstant());
314 case dwarf::DW_AT_comp_dir:
317 case dwarf::DW_AT_const_value:
326 if (FormValue.
getForm() == dwarf::DW_FORM_sdata) {
327 std::stringstream Stream;
334 CurrentElement->
setValue(Stream.str());
341 case dwarf::DW_AT_count:
344 case dwarf::DW_AT_decl_line:
347 case dwarf::DW_AT_decl_file:
349 ? GetAsUnsignedConstant() + 1
350 : GetAsUnsignedConstant());
352 case dwarf::DW_AT_enum_class:
353 if (GetFlag(FormValue))
354 CurrentElement->setIsEnumClass();
356 case dwarf::DW_AT_external:
357 if (GetFlag(FormValue))
358 CurrentElement->setIsExternal();
360 case dwarf::DW_AT_GNU_discriminator:
363 case dwarf::DW_AT_inline:
366 case dwarf::DW_AT_lower_bound:
369 case dwarf::DW_AT_name:
372 case dwarf::DW_AT_linkage_name:
373 case dwarf::DW_AT_MIPS_linkage_name:
376 case dwarf::DW_AT_producer:
377 if (
options().getAttributeProducer())
380 case dwarf::DW_AT_upper_bound:
383 case dwarf::DW_AT_virtuality:
387 case dwarf::DW_AT_abstract_origin:
388 case dwarf::DW_AT_call_origin:
389 case dwarf::DW_AT_extension:
390 case dwarf::DW_AT_import:
391 case dwarf::DW_AT_specification:
392 case dwarf::DW_AT_type:
393 updateReference(AttrSpec.
Attr, FormValue);
396 case dwarf::DW_AT_low_pc:
397 if (
options().getGeneralCollectRanges()) {
403 CurrentLowPC = *
Value;
406 if (
U->getAddrOffsetSectionItem(UValue)) {
418 CurrentElement->setIsDiscarded();
427 case dwarf::DW_AT_high_pc:
428 if (
options().getGeneralCollectRanges()) {
451 case dwarf::DW_AT_ranges:
452 if (RangesDataAvailable &&
options().getGeneralCollectRanges()) {
455 if (FormValue.
getForm() == dwarf::DW_FORM_rnglistx)
460 GetRanges(FormValue, U);
461 if (!RangesOrError) {
464 dbgs() <<
format(
"error decoding address ranges = ",
486 CurrentRanges.emplace_back(
Range.LowPC,
Range.HighPC);
492 case dwarf::DW_AT_data_member_location:
493 if (
options().getAttributeAnyLocation())
494 processLocationMember(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
498 case dwarf::DW_AT_location:
499 case dwarf::DW_AT_string_length:
500 case dwarf::DW_AT_use_location:
501 if (
options().getAttributeAnyLocation() && CurrentSymbol)
502 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
505 case dwarf::DW_AT_call_data_value:
506 case dwarf::DW_AT_call_value:
507 case dwarf::DW_AT_GNU_call_site_data_value:
508 case dwarf::DW_AT_GNU_call_site_value:
509 if (
options().getAttributeAnyLocation() && CurrentSymbol)
510 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry,
527 DIE.getDwarfUnit()->getDebugInfoExtractor();
534 CurrentEndOffset = 0;
548 CurrentElement = createElement(
Tag);
562 if (ElementTable.find(
Offset) == ElementTable.end()) {
564 ElementTable.emplace(std::piecewise_construct,
565 std::forward_as_tuple(
Offset),
566 std::forward_as_tuple(CurrentElement));
574 Target->setReference(CurrentElement);
576 Target->setType(CurrentElement);
586 else if (CurrentSymbol)
588 else if (CurrentType)
592 auto ProcessAttributes = [&](
const DWARFDie &TheDIE,
594 CurrentEndOffset =
Offset;
595 uint32_t abbrCode = DebugData.getULEB128(&CurrentEndOffset);
601 AbbrevDecl->attributes())
602 processOneAttribute(TheDIE, &CurrentEndOffset, AttrSpec);
606 ProcessAttributes(
DIE, DebugInfoData);
615 ProcessAttributes(InputDIE, DebugInfoData);
620 if (CurrentScope->getCanHaveRanges()) {
624 if (FoundLowPC && FoundHighPC) {
625 CurrentScope->
addObject(CurrentLowPC, CurrentHighPC);
628 if ((
options().getAttributePublics() ||
629 options().getPrintAnyLine()) &&
630 CurrentScope->getIsFunction() &&
631 !CurrentScope->getIsInlinedFunction())
632 CompileUnit->addPublicName(CurrentScope, CurrentLowPC,
640 if (CurrentScope->getHasRanges() &&
642 CurrentScope->getHasReferenceSpecification()) {
644 std::optional<DWARFFormValue> LinkageDIE =
645 DIE.findRecursively(dwarf::DW_AT_linkage_name);
646 if (LinkageDIE.has_value()) {
657 if (CurrentScope->getIsComdat())
662 if (!CurrentRanges.empty()) {
666 CurrentRanges.clear();
676 if (Parent->getIsAggregate())
677 CurrentScope->setIsMember();
681 if (
options().getAttributeAnyLocation() && CurrentSymbol &&
682 CurrentSymbol->getHasLocation())
683 SymbolsWithLocations.
push_back(CurrentSymbol);
686 if (CurrentType && CurrentType->getIsTemplateParam())
687 Parent->setIsTemplate();
703 traverseDieAndChildren(Child, Scope, DummyDie);
713void LVDWARFReader::processLocationGaps() {
714 if (
options().getAttributeAnyLocation())
715 for (
LVSymbol *Symbol : SymbolsWithLocations)
716 Symbol->fillLocationGaps();
719void LVDWARFReader::createLineAndFileRecords(
725 if (!
Lines->Prologue.FileNames.empty())
727 Lines->Prologue.FileNames) {
728 std::string Directory;
729 if (
Lines->getDirectoryForEntry(Entry, Directory))
731 if (Directory.empty())
732 Directory = std::string(
CompileUnit->getCompilationDirectory());
740 bool IncrementIndex =
Lines->Prologue.getVersion() >= 5;
754 CompileUnit->getFilename(IncrementIndex ? Row.File + 1 : Row.File));
755 Line->setLineNumber(Row.Line);
756 if (Row.Discriminator)
757 Line->setDiscriminator(Row.Discriminator);
759 Line->setIsNewStatement();
761 Line->setIsBasicBlock();
763 Line->setIsEndSequence();
764 if (Row.EpilogueBegin)
765 Line->setIsEpilogueBegin();
767 Line->setIsPrologueEnd();
770 <<
" Line: " <<
Line->lineNumberAsString(
true)
782 if (Opcode == dwarf::DW_OP_regval_type)
788 auto *MCRegInfo =
MRI.get();
792 if (std::optional<unsigned> LLVMRegNum =
793 MCRegInfo->getLLVMRegNum(DwarfRegNum, IsEH))
794 if (
const char *
RegName = MCRegInfo->getName(*LLVMRegNum))
820 "Could not create DWARF information: %s",
823 if (
Error Err = loadTargetInfo(Obj))
832 DwarfContext->getNumCompileUnits() ? DwarfContext->compile_units()
833 : DwarfContext->dwo_compile_units();
834 for (
const std::unique_ptr<DWARFUnit> &
CU : CompileUnits) {
887 auto DeduceIncrementFileIndex = [&]() ->
bool {
888 if (
CU->getVersion() < 5)
893 CU->getContext().getLineTableForUnit(
CU.get())) {
895 if (LT->hasFileAtIndex(0) && LT->hasFileAtIndex(1)) {
897 LT->Prologue.getFileNameEntry(0);
899 LT->Prologue.getFileNameEntry(1);
905 std::string FileZero;
908 LT->getFileNameByIndex(
909 0,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
911 LT->getFileNameByIndex(
912 1,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
914 return FileZero.compare(FileOne);
922 IncrementFileIndex = DeduceIncrementFileIndex();
927 std::optional<const char *> DWOFileName =
928 CU->getVersion() >= 5
940 DWOAlternativeLocation);
952 RangesDataAvailable =
957 traverseDieAndChildren(CUDie,
Root, SkeletonDie);
959 createLineAndFileRecords(DwarfContext->getLineTableForUnit(
CU.get()));
969 ScopesWithRanges->
sort();
972 processLocationGaps();
975 ScopesWithRanges->
clear();
976 SymbolsWithLocations.clear();
988 bool CallSiteLocation) {
1005 U->getFormParams().Format);
1018 if (FormValue.
getForm() == dwarf::DW_FORM_loclistx) {
1019 std::optional<uint64_t> LoclistOffset = U->getLoclistOffset(
Offset);
1025 if (std::optional<SectionedAddress> BA =
U->getBaseAddress())
1031 if (
Entry.Kind == dwarf::DW_LLE_base_address) {
1035 if (
Entry.Kind == dwarf::DW_LLE_offset_pair) {
1043 U->getAddressByteSize());
1055 Error E =
U->getLocationTable().visitLocationList(
1057 ProcessLocationEntry(E);
1076 processLocationList(Attr, FormValue, Die, OffsetOnEntry);
1096 Attr == dwarf::DW_AT_import || Attr == dwarf::DW_AT_type);
1098 if (FormValue.
getForm() == dwarf::DW_FORM_ref_addr) {
1101 Target->setIsGlobalReference();
1103 removeGlobalOffset(
Offset);
1117 case dwarf::DW_AT_abstract_origin:
1118 case dwarf::DW_AT_call_origin:
1120 CurrentElement->setHasReferenceAbstract();
1122 case dwarf::DW_AT_extension:
1124 CurrentElement->setHasReferenceExtension();
1126 case dwarf::DW_AT_specification:
1128 CurrentElement->setHasReferenceSpecification();
1130 case dwarf::DW_AT_import:
1131 case dwarf::DW_AT_type:
1142 auto Iter = ElementTable.try_emplace(
Offset).first;
1144 LVElementEntry &
Entry = Iter->second;
1145 if (!
Entry.Element) {
1147 Entry.Types.insert(Element);
1149 Entry.References.insert(Element);
1151 return Entry.Element;
1169 FeaturesValue = *Features;
1173void LVDWARFReader::mapRangeAddress(
const ObjectFile &Obj) {
1193 bool IsSTAB =
false;
1214 if (!AddressOrErr) {
BlockVerifier::State From
mir Rename Register Operands
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
A structured debug information entry.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
dwarf::Tag getTag() const
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
DWARFUnitVector::compile_unit_range compile_unit_range
bool isLittleEndian() const
static std::unique_ptr< DWARFContext > create(const object::ObjectFile &Obj, ProcessDebugRelocations RelocAction=ProcessDebugRelocations::Process, const LoadedObjectInfo *L=nullptr, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
uint64_t getOffset() const
Get the absolute offset into the debug info or types section.
std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
DWARFUnit * getDwarfUnit() const
DWARFDie getSibling() const
Get the sibling of this DIE object.
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
This class represents an Operation in the Expression.
ArrayRef< uint64_t > getRawOperands() const
static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS, DIDumpOptions DumpOpts, uint8_t Opcode, const ArrayRef< uint64_t > Operands)
DWARFDataExtractor getDebugInfoExtractor() const
uint64_t getOffset() const
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
Class representing an expression and its matching format.
virtual void printString(StringRef Value)
virtual raw_ostream & startLine()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
Manages the enabling and disabling of subtarget specific features.
std::string getString() const
Returns features as a string.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
LVSectionIndex updateSymbolTable(LVScope *Function)
LVSectionIndex getSectionIndex(LVScope *Scope) override
void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
void mapVirtualAddress(const object::ObjectFile &Obj)
std::unique_ptr< const MCRegisterInfo > MRI
LVRange * getSectionRanges(LVSectionIndex SectionIndex)
Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures)
void addSectionRange(LVSectionIndex SectionIndex, LVScope *Scope)
Error createInstructions()
LVAddress WasmCodeSectionOffset
void setCUHighAddress(LVAddress Address)
void print(raw_ostream &OS) const
std::string getRegisterName(LVSmall Opcode, ArrayRef< uint64_t > Operands) override
void sortScopes() override
void setCUBaseAddress(LVAddress Address)
Error createScopes() override
virtual void setCount(int64_t Value)
virtual void setCallLineNumber(uint32_t Number)
virtual void setBitSize(uint32_t Size)
virtual void setLinkageName(StringRef LinkageName)
virtual void setProducer(StringRef ProducerName)
virtual void setUpperBound(int64_t Value)
virtual void setDiscriminator(uint32_t Value)
virtual void setLowerBound(int64_t Value)
virtual void setValue(StringRef Value)
void setInlineCode(uint32_t Code)
virtual void setReference(LVElement *Element)
void setName(StringRef ElementName) override
virtual bool isCompileUnit() const
void setAccessibilityCode(uint32_t Access)
void setVirtualityCode(uint32_t Virtuality)
void setType(LVElement *Element=nullptr)
void setFilenameIndex(size_t Index)
virtual void setCallFilenameIndex(size_t Index)
virtual size_t getLinkageNameIndex() const
void setOffset(LVOffset DieOffset)
void setLineNumber(uint32_t Number)
void setTag(dwarf::Tag Tag)
void addCompileUnitOffset(LVOffset Offset, LVScopeCompileUnit *CompileUnit)
std::string FileFormatName
std::string createAlternativePath(StringRef From)
StringRef getFilename() const
LVSectionIndex DotTextSectionIndex
virtual Error createScopes()
void addElement(LVElement *Element)
void addObject(LVLocation *Location)
void addLocation(dwarf::Attribute Attr, LVAddress LowPC, LVAddress HighPC, LVUnsigned SectionOffset, uint64_t LocDescOffset, bool CallSiteLocation=false)
void addLocationOperands(LVSmall Opcode, ArrayRef< uint64_t > Operands)
void addLocationConstant(dwarf::Attribute Attr, LVUnsigned Constant, uint64_t LocDescOffset)
StringRef getFileName() const
MachO::nlist getSymbolTableEntry(DataRefImpl DRI) const
MachO::nlist_64 getSymbol64TableEntry(DataRefImpl DRI) const
bool is64Bit() const override
This class is the base class for all object file types.
virtual section_iterator section_end() const =0
virtual Expected< SubtargetFeatures > getFeatures() const =0
virtual Triple::ArchType getArch() const =0
This is a value type class that represents a single symbol in the list of symbols in the object file.
virtual basic_symbol_iterator symbol_begin() const =0
virtual basic_symbol_iterator symbol_end() const =0
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
StringRef toStringRef(const std::optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
FormattedNumber hexValue(uint64_t N, unsigned Width=HEX_WIDTH, bool Upper=false)
std::string hexString(uint64_t Value, size_t Width=HEX_WIDTH)
const LVAddress MaxAddress
std::string transformPath(StringRef Path)
constexpr bool UpdateHighAddress
std::pair< LVAddress, LVAddress > LVAddressRange
This is an optimization pass for GlobalISel generic memory operations.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
auto formatv(const char *Fmt, Ts &&...Vals) -> formatv_object< decltype(std::make_tuple(support::detail::build_format_adapter(std::forward< Ts >(Vals))...))>
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
void consumeError(Error Err)
Consume a Error without doing anything.
Container for dump options that control which debug information will be dumped.
std::function< llvm::StringRef(uint64_t DwarfRegNum, bool IsEH)> GetNameForDWARFReg
bool isImplicitConst() const
int64_t getImplicitConstValue() const
static bool mayHaveLocationList(dwarf::Attribute Attr)
Identify DWARF attributes that may contain a pointer to a location list.
static bool mayHaveLocationExpr(dwarf::Attribute Attr)
Identifies DWARF attributes that may contain a reference to a DWARF expression.
Standard .debug_line state machine structure.
A single location within a location list.
Represents a single DWARF expression, whose value is location-dependent.
static const uint64_t UndefSection