LLVM  11.0.0git
Functions
InlineInfo.cpp File Reference
#include "llvm/DebugInfo/GSYM/FileEntry.h"
#include "llvm/DebugInfo/GSYM/FileWriter.h"
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/DebugInfo/GSYM/InlineInfo.h"
#include "llvm/Support/DataExtractor.h"
#include <algorithm>
#include <inttypes.h>
Include dependency graph for InlineInfo.cpp:

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. More...
 
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. More...
 
static llvm::Expected< InlineInfodecode (DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr)
 Decode an InlineInfo in Data at the specified offset. More...
 

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::gsym::InlineInfo::CallFile, llvm::gsym::InlineInfo::CallLine, llvm::gsym::InlineInfo::Children, llvm::createStringError(), llvm::gsym::AddressRanges::decode(), llvm::gsym::InlineInfo::decode(), llvm::gsym::AddressRanges::empty(), llvm::Expected< T >::get(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), llvm::DataExtractor::isValidOffset(), llvm::DataExtractor::isValidOffsetForDataOfSize(), llvm::gsym::InlineInfo::Name, llvm::gsym::InlineInfo::Ranges, and llvm::Expected< T >::takeError().

Referenced by llvm::gsym::InlineInfo::decode(), and encodeCnt().

◆ getInlineStackHelper()

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

◆ 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.

Referenced by llvm::GVNExpression::Expression::dump(), llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::emitAndFinalize(), llvm::MDGlobalAttachmentMap::empty(), llvm::DwarfCompileUnit::finishSubprogramDefinition(), llvm::DWARFDebugNames::Entry::getAbbrev(), llvm::DWARFDebugNames::Entry::getCUIndex(), llvm::AppleAcceleratorTable::Entry::getCUOffset(), llvm::AppleAcceleratorTable::Entry::getDIESectionOffset(), llvm::DWARFDebugNames::Entry::getDIEUnitOffset(), llvm::AMDGPULibFunc::getOrInsertFunction(), llvm::AppleAcceleratorTable::Entry::getTag(), llvm::isAtLeastOrStrongerThan(), isDebug(), llvm::isStrongerThan(), llvm::AMDGPUUnmangledLibFunc::parseFuncName(), llvm::GVN::ValueTable::phiTranslate(), llvm::orc::RemoteObjectClientLayer< RPCEndpoint >::RemoteObjectClientLayer(), llvm::orc::RemoteObjectServerLayer< BaseLayerT, RPCEndpoint >::RemoteObjectServerLayer(), llvm::MDAttachmentMap::size(), 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::DataExtractor::getU32(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), and llvm::gsym::AddressRanges::skip().

Referenced by llvm::DataExtractor::getULEB128().