32 OS <<
" Name = " <<
HEX32(
II.Name) <<
", CallFile = " <<
II.CallFile
33 <<
", CallLine = " <<
II.CallFile <<
'\n';
34 for (
const auto &Child :
II.Children)
40 std::vector<const InlineInfo *> &InlineStack) {
41 if (
II.Ranges.contains(
Addr)) {
46 InlineStack.insert(InlineStack.begin(), &
II);
47 for (
const auto &Child :
II.Children) {
51 return !InlineStack.empty();
56std::optional<InlineInfo::InlineArray>
114 if (Inline.Ranges.empty())
118 if (!Inline.Ranges.contains(
Addr)) {
132 const auto ChildBaseAddr = Inline.Ranges[0].start();
138 std::optional<FileEntry> CallFile = GR.
getFile(Inline.CallFile);
141 "failed to extract file[%" PRIu32
"]",
146 if (CallFile->Dir || CallFile->Base) {
149 SrcLoc.
Offset = SrcLocs.back().Offset;
152 SrcLoc.
Line = Inline.CallLine;
153 SrcLocs.back().Name = GR.
getString(Inline.Name);
154 SrcLocs.
back().Offset =
Addr - Inline.Ranges[0].start();
155 SrcLocs.push_back(SrcLoc);
185 "0x%8.8" PRIx64
": missing InlineInfo address ranges data",
Offset);
187 if (Inline.Ranges.empty())
189 if (!
Data.isValidOffsetForDataOfSize(
Offset, 1))
191 "0x%8.8" PRIx64
": missing InlineInfo uint8_t indicating children",
194 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
196 "0x%8.8" PRIx64
": missing InlineInfo uint32_t for name",
Offset);
200 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call file",
Offset);
204 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call line",
Offset);
209 const auto ChildBaseAddr = Inline.Ranges[0].start();
215 if (Child.
get().Ranges.empty())
217 Inline.Children.emplace_back(std::move(*Child));
235 "attempted to encode invalid InlineInfo object");
237 bool HasChildren = !
Children.empty();
238 O.writeU8(HasChildren);
247 for (
const auto &Child :
Children) {
250 for (
const auto &ChildRange: Child.Ranges) {
253 "child range not contained in parent");
270 for (
const auto &Child :
II.Children)
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 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 uint64_t GetTotalNumChildren(const InlineInfo &II)
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr)
Decode an InlineInfo in Data at the specified offset.
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
uint64_t IntrinsicInst * II
bool contains(uint64_t Addr) 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.
char back() const
back - Get the last character in the string.
A simplified binary data writer class that doesn't require targets, target definitions,...
GsymReader is used to read GSYM data from a file or buffer.
std::optional< FileEntry > getFile(uint32_t Index) const
Get the a file entry for the suppplied file index.
StringRef getString(uint32_t Offset) const
Get a string from the string table.
This class implements an extremely fast bulk output stream that can only output to a stream.
void encodeRanges(const AddressRanges &Ranges, FileWriter &O, uint64_t BaseAddr)
raw_ostream & operator<<(raw_ostream &OS, const FunctionInfo &R)
void decodeRanges(AddressRanges &Ranges, DataExtractor &Data, uint64_t BaseAddr, uint64_t &Offset)
Address ranges are decoded and encoded to be relative to a base address.
uint64_t skipRanges(DataExtractor &Data, uint64_t &Offset)
Skip an address range object in the specified data a the specified offset.
std::vector< SourceLocation > SourceLocations
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
Inline information stores the name of the inline function along with an array of address ranges.
bool operator<(const InlineInfo &RHS) const
Compare InlineInfo objects.
std::vector< InlineInfo > Children
std::vector< const InlineInfo * > InlineArray
std::optional< InlineArray > getInlineStack(uint64_t Addr) const
Lookup an address in the InlineInfo object.
static llvm::Error lookup(const GsymReader &GR, DataExtractor &Data, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs)
Lookup a single address within the inline info data.
uint32_t CallFile
1 based file index in the file table.
llvm::Error encode(FileWriter &O, uint64_t BaseAddr) const
Encode this InlineInfo object into FileWriter stream.
uint32_t CallLine
Source line number.
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an InlineInfo object from a binary data stream.
uint32_t Name
String table offset in the string table.
StringRef Base
Line entry source file basename.
uint32_t Line
Source file line number.
uint32_t Offset
Byte size offset within the named function.
StringRef Dir
Line entry source file directory path.
StringRef Name
Function or symbol name.