[libcxx-commits] [PATCH] D91039: [libunwind] Delete unused codeOffsetAtStackDecrement/registersInOtherRegisters/sameValueUsed

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 8 12:47:15 PST 2020


MaskRay created this revision.
MaskRay added reviewers: libunwind, compnerd, mstorsjo.
Herald added projects: LLVM, libunwind.
Herald added subscribers: libcxx-commits, llvm-commits.
Herald added 1 blocking reviewer(s): libunwind.
MaskRay requested review of this revision.

ld64 uses them to create compact unwind from DWARF call frame information.
When the code was ported to libunwind, the variables were not deleted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91039

Files:
  libunwind/src/DwarfParser.hpp


Index: libunwind/src/DwarfParser.hpp
===================================================================
--- libunwind/src/DwarfParser.hpp
+++ libunwind/src/DwarfParser.hpp
@@ -88,9 +88,6 @@
     int32_t           cfaRegisterOffset;  // CFA = (cfaRegister)+cfaRegisterOffset
     int64_t           cfaExpression;      // CFA = expression
     uint32_t          spExtraArgSize;
-    uint32_t          codeOffsetAtStackDecrement;
-    bool              registersInOtherRegisters;
-    bool              sameValueUsed;
     RegisterLocation  savedRegisters[kMaxRegisterNumber + 1];
     enum class InitializeTime { kLazy, kNormal };
 
@@ -521,8 +518,6 @@
         // value has not changed, so no need to restore from frame.
         // We model this as if the register was never saved.
         results->setRegisterLocation(reg, kRegisterUnused, initialState);
-        // set flag to disable conversion to compact unwind
-        results->sameValueUsed = true;
         _LIBUNWIND_TRACE_DWARF("DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);
         break;
       case DW_CFA_register:
@@ -540,8 +535,6 @@
         }
         results->setRegister(reg, kRegisterInRegister, (int64_t)reg2,
                              initialState);
-        // set flag to disable conversion to compact unwind
-        results->registersInOtherRegisters = true;
         _LIBUNWIND_TRACE_DWARF(
             "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2);
         break;
@@ -598,7 +591,6 @@
       case DW_CFA_def_cfa_offset:
         results->cfaRegisterOffset =
             (int32_t)addressSpace.getULEB128(p, instructionsEnd);
-        results->codeOffsetAtStackDecrement = (uint32_t)codeOffset;
         _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset(%d)\n",
                                results->cfaRegisterOffset);
         break;
@@ -662,7 +654,6 @@
         results->cfaRegisterOffset =
             (int32_t)(addressSpace.getSLEB128(p, instructionsEnd) *
                       cieInfo.dataAlignFactor);
-        results->codeOffsetAtStackDecrement = (uint32_t)codeOffset;
         _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset_sf(%d)\n",
                                results->cfaRegisterOffset);
         break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91039.303734.patch
Type: text/x-patch
Size: 2229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201108/0c37298f/attachment.bin>


More information about the libcxx-commits mailing list