[NFC] Make unwind table internal data structures more accessible (#145804)

All these changes are being used in
[PR#145633](https://github.com/llvm/llvm-project/pull/145633)

`CFIProgram`:
- `addInstruction` methods already exists, but more convenient ones are
private, this PR makes them public

`UnwindLocation`:
- Added a field accessor method for `Dereference` like other field
access methods.
This commit is contained in:
AmirHossein PashaeeHir
2025-06-27 15:54:47 -07:00
committed by GitHub
parent c43282ab69
commit 5ecd21a46a
2 changed files with 8 additions and 6 deletions

View File

@@ -138,6 +138,8 @@ public:
return *AddrSpace;
}
int32_t getConstant() const { return Offset; }
bool getDereference() const { return Dereference; }
/// Some opcodes will modify the CFA location's register only, so we need
/// to be able to modify the CFA register when evaluating DWARF Call Frame
/// Information opcodes.

View File

@@ -254,12 +254,6 @@ public:
/// above. This is indexed by opcode.
LLVM_ABI static ArrayRef<OperandType[MaxOperands]> getOperandTypes();
private:
std::vector<Instruction> Instructions;
const uint64_t CodeAlignmentFactor;
const int64_t DataAlignmentFactor;
Triple::ArchType Arch;
/// Convenience method to add a new instruction with the given opcode.
void addInstruction(uint8_t Opcode) {
Instructions.push_back(Instruction(Opcode));
@@ -286,6 +280,12 @@ private:
Instructions.back().Ops.push_back(Operand2);
Instructions.back().Ops.push_back(Operand3);
}
private:
std::vector<Instruction> Instructions;
const uint64_t CodeAlignmentFactor;
const int64_t DataAlignmentFactor;
Triple::ArchType Arch;
};
} // end namespace dwarf