[PATCH] D130315: [DWARF][BOLT] Implement new mechanism for DWARFRewriter

Rui Zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 22:06:49 PDT 2022


zr33 added inline comments.


================
Comment at: bolt/lib/Rewrite/DWARFRewriter.cpp:966
+                for (uint8_t byte : Tmp) {
+                  DIEBldr.addValue(NewAttr, static_cast<dwarf::Attribute>(0),
+                                   dwarf::DW_FORM_data1, DIEInteger(byte));
----------------
ayermolo wrote:
> Not sure this logic is correct.
> 
> > The DW_OP_addrx operation has a single operand that encodes an unsigned
> > 15 LEB128
> 
> 
This part is create a DIE IR for DW_AT_location. In this process, we keep tracking the size of new expressions.
1. We first get the new Index and calculate the LEB128 format for this index. 
2. Append the opcode into IR.
3. Append the the LEB128 format index into IR.
After iterating all the expression, update the size of IR.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130315/new/

https://reviews.llvm.org/D130315



More information about the llvm-commits mailing list