LLVM 20.0.0git
Functions
InlineInfo.cpp File Reference
#include "llvm/DebugInfo/GSYM/InlineInfo.h"
#include "llvm/DebugInfo/GSYM/FileEntry.h"
#include "llvm/DebugInfo/GSYM/FileWriter.h"
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/Support/DataExtractor.h"
#include <inttypes.h>

Go to the source code of this file.

Functions

static bool getInlineStackHelper (const InlineInfo &II, uint64_t Addr, std::vector< const InlineInfo * > &InlineStack)
 
static bool skip (DataExtractor &Data, uint64_t &Offset, bool SkippedRanges)
 Skip an InlineInfo object in the specified data at the specified offset.
 
static bool lookup (const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
 A Lookup helper functions.
 
static llvm::Expected< InlineInfodecode (DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr)
 Decode an InlineInfo in Data at the specified offset.
 
static uint64_t GetTotalNumChildren (const InlineInfo &II)
 

Function Documentation

◆ decode()

static llvm::Expected< InlineInfo > decode ( DataExtractor Data,
uint64_t Offset,
uint64_t  BaseAddr 
)
static

Decode an InlineInfo in Data at the specified offset.

A local helper function to decode InlineInfo objects. This function is called recursively when parsing child InlineInfo objects.

Parameters
DataThe data extractor to decode from.
OffsetThe offset within Data to decode from.
BaseAddrThe base address to use when decoding address ranges.
Returns
An InlineInfo or an error describing the issue that was encountered during decoding.

Definition at line 179 of file InlineInfo.cpp.

References llvm::createStringError(), llvm::Data, decode(), llvm::gsym::decodeRanges(), llvm::Expected< T >::get(), llvm::Offset, and llvm::Expected< T >::takeError().

Referenced by decode(), and encodeCnt().

◆ getInlineStackHelper()

static bool getInlineStackHelper ( const InlineInfo II,
uint64_t  Addr,
std::vector< const InlineInfo * > &  InlineStack 
)
static

Definition at line 38 of file InlineInfo.cpp.

References Addr, getInlineStackHelper(), and II.

Referenced by llvm::gsym::InlineInfo::getInlineStack(), and getInlineStackHelper().

◆ GetTotalNumChildren()

static uint64_t GetTotalNumChildren ( const InlineInfo II)
static

Definition at line 267 of file InlineInfo.cpp.

References GetTotalNumChildren(), and II.

Referenced by GetTotalNumChildren(), and llvm::gsym::InlineInfo::operator<().

◆ lookup()

static bool lookup ( const GsymReader GR,
DataExtractor Data,
uint64_t Offset,
uint64_t  BaseAddr,
uint64_t  Addr,
SourceLocations SrcLocs,
llvm::Error Err 
)
static

A Lookup helper functions.

Used during the InlineInfo::lookup() call to quickly only parse an InlineInfo object if the address falls within this object. This avoids allocations by not appending child InlineInfo objects to the InlineInfo::Children array and also skips any InlineInfo objects that do not contain the address we are looking up.

Parameters
DataThe binary stream to read the data from.
OffsetThe byte offset within Data.
BaseAddrThe address that the relative address range offsets are relative to.

Definition at line 108 of file InlineInfo.cpp.

References Addr, llvm::StringRef::back(), llvm::gsym::SourceLocation::Base, llvm::createStringError(), llvm::Data, llvm::gsym::decodeRanges(), llvm::gsym::SourceLocation::Dir, llvm::Done, llvm::gsym::GsymReader::getFile(), llvm::gsym::GsymReader::getString(), llvm::gsym::SourceLocation::Line, lookup(), llvm::gsym::SourceLocation::Name, llvm::gsym::SourceLocation::Offset, llvm::Offset, and skip().

Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfCompileUnit::finishSubprogramDefinition(), llvm::DWARFDebugNames::Entry::getCUIndex(), llvm::AppleAcceleratorTable::Entry::getCUOffset(), llvm::AppleAcceleratorTable::Entry::getDIESectionOffset(), llvm::DWARFDebugNames::Entry::getDIEUnitOffset(), llvm::NVPTXRegisterInfo::getDwarfRegNum(), llvm::X86InstrInfo::getExecutionDomain(), llvm::DWARFDebugNames::Entry::getParentDIEEntry(), llvm::DWARFDebugNames::Entry::getRelatedCUIndex(), llvm::AppleAcceleratorTable::Entry::getTag(), llvm::DWARFDebugNames::Entry::getTUIndex(), llvm::DWARFDebugNames::Entry::hasParentInformation(), llvm::isAtLeastOrStrongerThan(), llvm::isStrongerThan(), lookup(), llvm::X86InstrInfo::setExecutionDomain(), llvm::X86InstrInfo::setExecutionDomainCustom(), and llvm::toCABI().

◆ skip()

static bool skip ( DataExtractor Data,
uint64_t Offset,
bool  SkippedRanges 
)
static

Skip an InlineInfo object in the specified data at the specified offset.

Used during the InlineInfo::lookup() call to quickly skip child InlineInfo objects where the addres ranges isn't contained in the InlineInfo object or its children. This avoids allocations by not appending child InlineInfo objects to the InlineInfo::Children array.

Parameters
DataThe binary stream to read the data from.
OffsetThe byte offset within Data.
SkippedRangesIf true, address ranges have already been skipped.

Definition at line 76 of file InlineInfo.cpp.

References llvm::Data, llvm::Offset, skip(), and llvm::gsym::skipRanges().

Referenced by canBeFeederToNewValueJump(), lookup(), and skip().