Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Object/StackMapParser.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | public: | ||||
public: | public: | ||||
/// Get the function address. | /// Get the function address. | ||||
uint64_t getFunctionAddress() const { | uint64_t getFunctionAddress() const { | ||||
return read<uint64_t>(P); | return read<uint64_t>(P); | ||||
} | } | ||||
/// Get the function's stack size. | /// Get the function's stack size. | ||||
uint32_t getStackSize() const { | uint64_t getStackSize() const { | ||||
sanjoy: Just to be clear: this was wrong to begin with (for functions with stack frames larger than 4… | |||||
Not Done ReplyInline ActionsYes, this was an existing issue I noticed and fixed, since the field is 64 bits. kavon: Yes, this was an existing issue I noticed and fixed, since the field is 64 bits. | |||||
return read<uint64_t>(P + sizeof(uint64_t)); | return read<uint64_t>(P + sizeof(uint64_t)); | ||||
} | } | ||||
/// Get the number of callsite records. | |||||
uint64_t getRecordCount() const { | |||||
return read<uint64_t>(P + (2 * sizeof(uint64_t))); | |||||
} | |||||
private: | private: | ||||
FunctionAccessor(const uint8_t *P) : P(P) {} | FunctionAccessor(const uint8_t *P) : P(P) {} | ||||
const static int FunctionAccessorSize = 2 * sizeof(uint64_t); | const static int FunctionAccessorSize = 3 * sizeof(uint64_t); | ||||
FunctionAccessor next() const { | FunctionAccessor next() const { | ||||
return FunctionAccessor(P + FunctionAccessorSize); | return FunctionAccessor(P + FunctionAccessorSize); | ||||
} | } | ||||
const uint8_t *P; | const uint8_t *P; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | private: | ||||
} | } | ||||
static const unsigned HeaderOffset = 0; | static const unsigned HeaderOffset = 0; | ||||
static const unsigned NumFunctionsOffset = HeaderOffset + sizeof(uint32_t); | static const unsigned NumFunctionsOffset = HeaderOffset + sizeof(uint32_t); | ||||
static const unsigned NumConstantsOffset = NumFunctionsOffset + sizeof(uint32_t); | static const unsigned NumConstantsOffset = NumFunctionsOffset + sizeof(uint32_t); | ||||
static const unsigned NumRecordsOffset = NumConstantsOffset + sizeof(uint32_t); | static const unsigned NumRecordsOffset = NumConstantsOffset + sizeof(uint32_t); | ||||
static const unsigned FunctionListOffset = NumRecordsOffset + sizeof(uint32_t); | static const unsigned FunctionListOffset = NumRecordsOffset + sizeof(uint32_t); | ||||
static const unsigned FunctionSize = 2 * sizeof(uint64_t); | static const unsigned FunctionSize = 3 * sizeof(uint64_t); | ||||
static const unsigned ConstantSize = sizeof(uint64_t); | static const unsigned ConstantSize = sizeof(uint64_t); | ||||
std::size_t getFunctionOffset(unsigned FunctionIndex) const { | std::size_t getFunctionOffset(unsigned FunctionIndex) const { | ||||
return FunctionListOffset + FunctionIndex * FunctionSize; | return FunctionListOffset + FunctionIndex * FunctionSize; | ||||
} | } | ||||
std::size_t getConstantOffset(unsigned ConstantIndex) const { | std::size_t getConstantOffset(unsigned ConstantIndex) const { | ||||
return ConstantsListOffset + ConstantIndex * ConstantSize; | return ConstantsListOffset + ConstantIndex * ConstantSize; | ||||
Show All 10 Lines |
Just to be clear: this was wrong to begin with (for functions with stack frames larger than 4 gb :) )?