Go to the documentation of this file.
25 for (
auto Range : II.
Ranges) {
33 <<
", CallLine = " << II.
CallFile <<
'\n';
34 for (
const auto &Child : II.
Children)
40 std::vector<const InlineInfo *> &InlineStack) {
46 InlineStack.insert(InlineStack.begin(), &II);
47 for (
const auto &Child : II.
Children) {
51 return !InlineStack.empty();
56 std::optional<InlineInfo::InlineArray>
82 bool HasChildren =
Data.getU8(&Offset) != 0;
84 Data.getULEB128(&Offset);
85 Data.getULEB128(&Offset);
114 if (Inline.Ranges.empty())
118 if (!Inline.Ranges.contains(
Addr)) {
125 bool HasChildren =
Data.getU8(&Offset) != 0;
126 Inline.Name =
Data.getU32(&Offset);
132 const auto ChildBaseAddr = Inline.Ranges[0].start();
135 Done =
lookup(GR,
Data, Offset, ChildBaseAddr,
Addr, SrcLocs, Err);
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);
183 if (!
Data.isValidOffset(Offset))
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",
193 bool HasChildren =
Data.getU8(&Offset) != 0;
194 if (!
Data.isValidOffsetForDataOfSize(Offset, 4))
196 "0x%8.8" PRIx64
": missing InlineInfo uint32_t for name", Offset);
197 Inline.Name =
Data.getU32(&Offset);
198 if (!
Data.isValidOffset(Offset))
200 "0x%8.8" PRIx64
": missing ULEB128 for InlineInfo call file", Offset);
202 if (!
Data.isValidOffset(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");
std::vector< SourceLocation > SourceLocations
This is an optimization pass for GlobalISel generic memory operations.
bool contains(uint64_t Addr) const
static ErrorSuccess success()
Create a success value.
StringRef Name
Function or symbol name.
Tagged union holding either a T or a Error.
uint32_t CallFile
1 based file index in the file table.
Inline information stores the name of the inline function along with an array of address ranges.
StringRef Dir
Line entry source file directory path.
uint32_t Offset
Byte size offset within the named function.
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.
uint32_t CallLine
Source line number.
GsymReader is used to read GSYM data from a file or buffer.
raw_ostream & operator<<(raw_ostream &OS, const FunctionInfo &R)
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an InlineInfo object from a binary data stream.
uint64_t skipRanges(DataExtractor &Data, uint64_t &Offset)
Skip an address range object in the specified data a the specified offset.
StringRef getString(uint32_t Offset) const
Get a string from the string table.
static bool skip(DataExtractor &Data, uint64_t &Offset, bool SkippedRanges)
Skip an InlineInfo object in the specified data at the specified offset.
into llvm powi allowing the code generator to produce balanced multiplication trees First
This class implements an extremely fast bulk output stream that can only output to a stream.
llvm::Error encode(FileWriter &O, uint64_t BaseAddr) const
Encode this InlineInfo object into FileWriter stream.
uint32_t Name
String table offset in the string table.
std::optional< InlineArray > getInlineStack(uint64_t Addr) const
Lookup an address in the InlineInfo object.
std::vector< const InlineInfo * > InlineArray
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
A simplified binary data writer class that doesn't require targets, target definitions,...
StringRef Base
Line entry source file basename.
static llvm::Expected< InlineInfo > decode(DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr)
Decode an InlineInfo in Data at the specified offset.
reference get()
Returns a reference to the stored T value.
void encodeRanges(const AddressRanges &Ranges, FileWriter &O, uint64_t BaseAddr)
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Lightweight error class with error context and mandatory checking.
Error takeError()
Take ownership of the stored error.
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.
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.
char back() const
back - Get the last character in the string.
std::optional< FileEntry > getFile(uint32_t Index) const
Get the a file entry for the suppplied file index.
static bool getInlineStackHelper(const InlineInfo &II, uint64_t Addr, std::vector< const InlineInfo * > &InlineStack)
std::vector< InlineInfo > Children
uint32_t Line
Source file line number.