|
LLVM 24.0.0git
|
Namespaces | |
| namespace | classic |
| namespace | parallel |
Classes | |
| class | AddressesMap |
| AddressesMap represents information about valid addresses used by debug information. More... | |
| class | DWARFFile |
| This class represents DWARF information for source file and it's address map. More... | |
| class | DWARFLinkerBase |
| The base interface for DWARFLinker implementations. More... | |
| class | IndexedValuesMap |
| This class stores values sequentually and assigns index to the each value. More... | |
| class | StringPool |
Typedefs | |
| using | RangesTy = AddressRangesMap |
| Mapped value in the address map is the offset to apply to the linked address. | |
| using | StringEntry = StringMapEntry<EmptyStringSetTag> |
| StringEntry keeps data of the string: the length, external offset and a string body which is placed right after StringEntry. | |
Enumerations | |
| enum class | DebugSectionKind : uint8_t { DebugInfo = 0 , DebugLine , DebugFrame , DebugRange , DebugRngLists , DebugLoc , DebugLocLists , DebugARanges , DebugAbbrev , DebugMacinfo , DebugMacro , DebugAddr , DebugStr , DebugLineStr , DebugStrOffsets , DebugPubNames , DebugPubTypes , DebugNames , AppleNames , AppleNamespaces , AppleObjC , AppleTypes , NumberOfEnumEntries } |
| List of tracked debug tables. More... | |
Functions | |
| static constexpr const StringLiteral & | getSectionName (DebugSectionKind SectionKind) |
| Return the name of the section. | |
| LLVM_ABI std::optional< DebugSectionKind > | parseDebugTableName (StringRef Name) |
| Recognise the table name and match it with the DebugSectionKind. | |
| LLVM_ABI bool | hasImplicitAddressLocation (const DWARFDie &Die) |
Test if the location of variable Die contains a global address but only uses to compute the variable's value, for example DW_OP_addr DW_OP_stack_value. | |
| LLVM_ABI bool | isStaticDataMember (const DWARFDie &Die) |
Test if the DW_TAG_member Die is a DWARF 2-4 style static data member: a declaration with no storage in the record. | |
| LLVM_ABI bool | isIdentifiedByChildren (dwarf::Tag Tag) |
Test if an unnamed type with tag Tag is identified by its children, which tell it apart from other unnamed types declared on the same line. | |
| LLVM_ABI bool | isIdentifyingChild (const DWARFDie &Die) |
Test if Die is a child that identifies its unnamed parent type. | |
| LLVM_ABI uint32_t | hashFullyQualifiedName (DWARFDie Die, function_ref< DWARFDie(const DWARFDie &, const DWARFFormValue &)> ResolveRef) |
Hash the fully qualified name of type Die for the Apple accelerator tables. | |
| LLVM_ABI void | buildStmtSeqOffsetToFirstRowIndex (const DWARFDebugLine::LineTable <, ArrayRef< uint64_t > SortedStmtSeqOffsets, DenseMap< uint64_t, uint64_t > &SeqOffToFirstRow) |
Build a map from an input DW_AT_LLVM_stmt_sequence byte offset to the first-row index (in LT.Rows) of the corresponding line-table sequence. | |
| Error | finiteLoop (function_ref< Expected< bool >()> Iteration, size_t MaxCounter=100000) |
This function calls Iteration() until it returns false. | |
| StringRef | guessDeveloperDir (StringRef SysRoot) |
| Make a best effort to guess the Xcode.app/Contents/Developer path from an SDK path. | |
| bool | isInToolchainDir (StringRef Path) |
| Make a best effort to determine whether Path is inside a toolchain. | |
| bool | isPathAbsoluteOnWindowsOrPosix (const Twine &Path) |
| static uint32_t | hashFullyQualifiedName (DWARFDie Die, function_ref< DWARFDie(const DWARFDie &, const DWARFFormValue &)> ResolveRef, bool IsScope, SmallPtrSetImpl< const DWARFDebugInfoEntry * > &Visited) |
Variables | |
| static constexpr size_t | SectionKindsNum |
| static constexpr StringLiteral | SectionNames [SectionKindsNum] |
Mapped value in the address map is the offset to apply to the linked address.
Definition at line 24 of file AddressesMap.h.
StringEntry keeps data of the string: the length, external offset and a string body which is placed right after StringEntry.
Definition at line 23 of file StringPool.h.
|
strong |
List of tracked debug tables.
Definition at line 29 of file DWARFLinkerBase.h.
| void llvm::dwarf_linker::buildStmtSeqOffsetToFirstRowIndex | ( | const DWARFDebugLine::LineTable & | LT, |
| ArrayRef< uint64_t > | SortedStmtSeqOffsets, | ||
| DenseMap< uint64_t, uint64_t > & | SeqOffToFirstRow ) |
Build a map from an input DW_AT_LLVM_stmt_sequence byte offset to the first-row index (in LT.Rows) of the corresponding line-table sequence.
Seeds the map from LT.Sequences (the DWARF parser's discovered sequences), then augments it by walking row boundaries (DW_LNE_end_sequence markers) and matching them against the sorted input offsets in SortedStmtSeqOffsets, using the parser's results as ground-truth anchors. This recovers sequences the parser may not have registered and keeps the classic and parallel DWARFLinkers in lockstep. Caller passes SortedStmtSeqOffsets sorted ascending and deduplicated.
Definition at line 135 of file Utils.cpp.
References llvm::ArrayRef(), llvm::ArrayRef< T >::consume_front(), llvm::ArrayRef< T >::drop_front(), llvm::ArrayRef< T >::drop_while(), llvm::ArrayRef< T >::empty(), llvm::enumerate(), llvm::DWARFDebugLine::Sequence::FirstRowIndex, llvm::ArrayRef< T >::front(), I, N, llvm::Off, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::DWARFDebugLine::Sequence::StmtSeqOffset, and uint64_t.
Referenced by llvm::constructSeqOffsettoOrigRowMapping().
|
inline |
This function calls Iteration() until it returns false.
If number of iterations exceeds MaxCounter then an Error is returned. This function should be used for loops which assumed to have number of iterations significantly smaller than MaxCounter to avoid infinite looping in error cases.
Definition at line 76 of file Utils.h.
References llvm::createStringError(), llvm::Expected< T >::get(), llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by hashFullyQualifiedName(), llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::link(), and llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::linkSingleCompileUnit().
|
staticconstexpr |
Return the name of the section.
Definition at line 68 of file DWARFLinkerBase.h.
References SectionNames.
Referenced by llvm::dwarf_linker::parallel::SectionDescriptorBase::getName(), llvm::dwarf_linker::parallel::OutputSections::getSectionDescriptor(), llvm::dwarf_linker::parallel::OutputSections::getSectionDescriptor(), llvm::object::ELFFile< ELFT >::getSectionName(), llvm::object::ELFObjectFile< ELFT >::isDebugSection(), and parseDebugTableName().
Make a best effort to guess the Xcode.app/Contents/Developer path from an SDK path.
Definition at line 91 of file Utils.h.
References llvm::StringRef::data(), llvm::sys::path::rbegin(), and llvm::sys::path::rend().
Referenced by llvm::analyzeImportedModule(), and llvm::dwarf_linker::parallel::CompileUnit::analyzeImportedModule().
| uint32_t llvm::dwarf_linker::hashFullyQualifiedName | ( | DWARFDie | Die, |
| function_ref< DWARFDie(const DWARFDie &, const DWARFFormValue &)> | ResolveRef ) |
Hash the fully qualified name of type Die for the Apple accelerator tables.
ResolveRef returns the DIE that a DW_AT_specification or DW_AT_abstract_origin of its first argument refers to, or an invalid DIE. A DW_TAG_module ends the name like the unit does, because LLDB leaves modules out of the qualified names it looks up.
Definition at line 127 of file Utils.cpp.
References hashFullyQualifiedName().
Referenced by hashFullyQualifiedName(), hashFullyQualifiedName(), and llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::save().
|
static |
Definition at line 84 of file Utils.cpp.
References llvm::consumeError(), llvm::djbHash(), llvm::DWARFFormValue::FC_Reference, llvm::DWARFDie::find(), finiteLoop(), llvm::DWARFDie::getDebugInfoEntry(), llvm::DWARFDie::getName(), llvm::DWARFDie::getParent(), llvm::DWARFDie::getTag(), hashFullyQualifiedName(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::dwarf::isUnitType(), llvm::Ref, and llvm::ShortName.
Test if the location of variable Die contains a global address but only uses to compute the variable's value, for example DW_OP_addr DW_OP_stack_value.
Definition at line 23 of file Utils.cpp.
References llvm::any_of(), llvm::Block, llvm::Data, llvm::DWARFDie::find(), and llvm::DWARFDie::getDwarfUnit().
Referenced by llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::save().
| bool llvm::dwarf_linker::isIdentifiedByChildren | ( | dwarf::Tag | Tag | ) |
Test if an unnamed type with tag Tag is identified by its children, which tell it apart from other unnamed types declared on the same line.
Other unnamed types, like pointer types, have no such children.
Definition at line 57 of file Utils.cpp.
References llvm::Tag.
Referenced by llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::addUnnamedTypeContents(), and llvm::appendUnnamedTypeContents().
Test if Die is a child that identifies its unnamed parent type.
Definition at line 70 of file Utils.cpp.
References llvm::DWARFDie::getTag(), and isStaticDataMember().
Referenced by llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::addUnnamedTypeContents(), and llvm::appendUnnamedTypeContents().
Make a best effort to determine whether Path is inside a toolchain.
Definition at line 127 of file Utils.h.
References llvm::sys::path::rbegin(), and llvm::sys::path::rend().
Referenced by llvm::analyzeImportedModule(), and llvm::dwarf_linker::parallel::CompileUnit::analyzeImportedModule().
Definition at line 148 of file Utils.h.
References llvm::sys::path::is_absolute(), llvm::sys::path::posix, and llvm::sys::path::windows.
Referenced by llvm::dwarf_linker::parallel::CompileUnit::getDirAndFilenameFromLineTable(), and llvm::DWARFDebugLine::Prologue::getFileNameByIndex().
Test if the DW_TAG_member Die is a DWARF 2-4 style static data member: a declaration with no storage in the record.
DWARF 5 uses a DW_TAG_variable instead.
Definition at line 43 of file Utils.cpp.
References assert(), llvm::DWARFDie::find(), llvm::DWARFDie::getTag(), and llvm::dwarf::toUnsigned().
Referenced by llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::addTypePrefix(), isIdentifyingChild(), and llvm::dwarf_linker::parallel::OrderedChildrenIndexAssigner::tagToArrayIndex().
| std::optional< DebugSectionKind > llvm::dwarf_linker::parseDebugTableName | ( | llvm::StringRef | SecName | ) |
Recognise the table name and match it with the DebugSectionKind.
Definition at line 16 of file DWARFLinkerBase.cpp.
References AppleNames, AppleNamespaces, AppleObjC, AppleTypes, llvm::StringSwitch< T, R >::Case(), DebugAbbrev, DebugAddr, DebugARanges, DebugFrame, DebugInfo, DebugLine, DebugLineStr, DebugLoc, DebugLocLists, DebugMacinfo, DebugMacro, DebugNames, DebugPubNames, DebugPubTypes, DebugRange, DebugRngLists, DebugStr, DebugStrOffsets, llvm::StringSwitch< T, R >::Default(), llvm::StringRef::find_first_not_of(), getSectionName(), and llvm::StringRef::substr().
Referenced by llvm::dwarf_linker::parallel::SectionDescriptor::setSizesForSectionCreatedByAsmPrinter().
|
staticconstexpr |
Definition at line 55 of file DWARFLinkerBase.h.
|
staticconstexpr |
Definition at line 58 of file DWARFLinkerBase.h.
Referenced by llvm::DWARFFormValue::dumpAddressSection(), getSectionName(), and llvm::dxbc::SourceInfo::getSectionTypes().