Skip to content

Commit

Permalink
[libunwind] Delete unused codeOffsetAtStackDecrement/registersInOther…
Browse files Browse the repository at this point in the history
…Registers/sameValueUsed

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

Reviewed By: #libunwind, compnerd

Differential Revision: https://reviews.llvm.org/D91039
  • Loading branch information
MaskRay committed Nov 9, 2020
1 parent c8cd7e2 commit 2c481f1
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions libunwind/src/DwarfParser.hpp
Expand Up @@ -88,9 +88,6 @@ class CFI_Parser {
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 };

Expand Down Expand Up @@ -521,8 +518,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
// 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:
Expand All @@ -540,8 +535,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
}
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;
Expand Down Expand Up @@ -598,7 +591,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
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;
Expand Down Expand Up @@ -662,7 +654,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
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;
Expand Down

0 comments on commit 2c481f1

Please sign in to comment.