From: Philip Reames Date: Sat, 13 Apr 2019 01:50:50 +0000 (+0000) Subject: [StackMaps] Add explicit location size accessor to the stackmap parser X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edc744d5be3180f06a477a460b79c90fc1606e47;p=llvm [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: 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 --- diff --git a/include/llvm/Object/StackMapParser.h b/include/llvm/Object/StackMapParser.h index 8817516eb21..50e4bae13a5 100644 --- a/include/llvm/Object/StackMapParser.h +++ b/include/llvm/Object/StackMapParser.h @@ -114,6 +114,12 @@ public: return LocationKind(P[KindOffset]); } + /// Get the Size for this location. + uint8_t getSize() const { + return read(P + SizeOffset); + + } + /// Get the Dwarf register number for this location. uint16_t getDwarfRegNum() const { return read(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);