31 OS <<
" Name = " <<
HEX32(
II.Name) <<
", CallFile = " <<
II.CallFile
32 <<
", CallLine = " <<
II.CallFile <<
'\n';
33 for (
const auto &Child :
II.Children)
39 std::vector<const InlineInfo *> &InlineStack) {
40 if (
II.Ranges.contains(
Addr)) {
45 InlineStack.insert(InlineStack.begin(), &
II);
46 for (
const auto &Child :
II.Children) {
50 return !InlineStack.empty();
55std::optional<InlineInfo::InlineArray>
113 if (Inline.Ranges.empty())
117 if (!Inline.Ranges.contains(
Addr)) {
131 const auto ChildBaseAddr = Inline.Ranges[0].start();
137 std::optional<FileEntry> CallFile = GR.
getFile(Inline.CallFile);
140 "failed to extract file[%" PRIu32
"]",
145 if (CallFile->Dir || CallFile->Base) {
148 SrcLoc.
Offset = SrcLocs.back().Offset;
151 SrcLoc.
Line = Inline.CallLine;
152 SrcLocs.back().Name = GR.
getString(Inline.Name);
153 SrcLocs.
back().Offset =
Addr - Inline.Ranges[0].start();
154 SrcLocs.push_back(SrcLoc);
184 "0x%8.8" PRIx64
": missing InlineInfo address ranges data",
Offset);
186 if (Inline.Ranges.empty())
188 if (!
Data.isValidOffsetForDataOfSize(
Offset, 1))
190 "0x%8.8" PRIx64
": missing InlineInfo uint8_t indicating children",
193 if (!
Data.isValidOffsetForDataOfSize(
Offset, 4))
195 "0x%8.8" PRIx64
": missing InlineInfo uint32_t for name",
Offset);
199 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call file",
Offset);
203 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call line",
Offset);
208 const auto ChildBaseAddr = Inline.Ranges[0].start();
214 if (Child.
get().Ranges.empty())
216 Inline.Children.emplace_back(std::move(*Child));
234 "attempted to encode invalid InlineInfo object");
236 bool HasChildren = !
Children.empty();
237 O.writeU8(HasChildren);
246 for (
const auto &Child :
Children) {
249 for (
const auto &ChildRange: Child.Ranges) {
252 "child range not contained in parent");
269 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 CallSiteInfo &CSI)
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.