[llvm] r358319 - [StackMaps] Add explicit location size accessor to the stackmap parser

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 18:50:50 PDT 2019


Author: reames
Date: Fri Apr 12 18:50:50 2019
New Revision: 358319

URL: http://llvm.org/viewvc/llvm-project?rev=358319&view=rev
Log:
[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 at kcl.ac.uk
Differential Revision: https://reviews.llvm.org/D59167


Modified:
    llvm/trunk/include/llvm/Object/StackMapParser.h

Modified: llvm/trunk/include/llvm/Object/StackMapParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/StackMapParser.h?rev=358319&r1=358318&r2=358319&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/StackMapParser.h (original)
+++ llvm/trunk/include/llvm/Object/StackMapParser.h Fri Apr 12 18:50:50 2019
@@ -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);
 




More information about the llvm-commits mailing list