]> granicus.if.org Git - llvm/commitdiff
[StackMaps] Add explicit location size accessor to the stackmap parser
authorPhilip Reames <listmail@philipreames.com>
Sat, 13 Apr 2019 01:50:50 +0000 (01:50 +0000)
committerPhilip Reames <listmail@philipreames.com>
Sat, 13 Apr 2019 01:50:50 +0000 (01:50 +0000)
The reserved uint8 field in the location block of the stackmap record is used to denote the size of the location.

Patch By: jacob.hughes@kcl.ac.uk
Differential Revision: https://reviews.llvm.org/D59167

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358319 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/StackMapParser.h

index 8817516eb2128f1c14ee9ec21270548db60712a3..50e4bae13a5b039d09bcbfb655bed7cf3ab92131 100644 (file)
@@ -114,6 +114,12 @@ public:
       return LocationKind(P[KindOffset]);
     }
 
+    /// Get the Size for this location.
+    uint8_t getSize() const {
+        return read<uint8_t>(P + SizeOffset);
+
+    }
+
     /// Get the Dwarf register number for this location.
     uint16_t getDwarfRegNum() const {
       return read<uint16_t>(P + DwarfRegNumOffset);
@@ -148,7 +154,8 @@ public:
     }
 
     static const int KindOffset = 0;
-    static const int DwarfRegNumOffset = KindOffset + sizeof(uint16_t);
+    static const int SizeOffset = KindOffset + sizeof(uint8_t);
+    static const int DwarfRegNumOffset = SizeOffset + sizeof(uint8_t);
     static const int SmallConstantOffset = DwarfRegNumOffset + sizeof(uint16_t);
     static const int LocationAccessorSize = sizeof(uint64_t);