Skip to content

Commit cebf0b3

Browse files
committed
[StackMaps] Add explicit location size accessor to the stackmap parser
The reserved uint8 field in the location block of the stackmap record is used to denote the size of the location. Patch By: [email protected] Differential Revision: https://reviews.llvm.org/D59167 llvm-svn: 358319
1 parent 93e58d2 commit cebf0b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/include/llvm/Object/StackMapParser.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ class StackMapV2Parser {
114114
return LocationKind(P[KindOffset]);
115115
}
116116

117+
/// Get the Size for this location.
118+
uint8_t getSize() const {
119+
return read<uint8_t>(P + SizeOffset);
120+
121+
}
122+
117123
/// Get the Dwarf register number for this location.
118124
uint16_t getDwarfRegNum() const {
119125
return read<uint16_t>(P + DwarfRegNumOffset);
@@ -148,7 +154,8 @@ class StackMapV2Parser {
148154
}
149155

150156
static const int KindOffset = 0;
151-
static const int DwarfRegNumOffset = KindOffset + sizeof(uint16_t);
157+
static const int SizeOffset = KindOffset + sizeof(uint8_t);
158+
static const int DwarfRegNumOffset = SizeOffset + sizeof(uint8_t);
152159
static const int SmallConstantOffset = DwarfRegNumOffset + sizeof(uint16_t);
153160
static const int LocationAccessorSize = sizeof(uint64_t);
154161

0 commit comments

Comments
 (0)