[llvm] 5ecd21a - [NFC] Make unwind table internal data structures more accessible (#145804)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 15:54:51 PDT 2025


Author: AmirHossein PashaeeHir
Date: 2025-06-27T15:54:47-07:00
New Revision: 5ecd21a46ab1344499af4fdc0c7d4f793909d53b

URL: https://github.com/llvm/llvm-project/commit/5ecd21a46ab1344499af4fdc0c7d4f793909d53b
DIFF: https://github.com/llvm/llvm-project/commit/5ecd21a46ab1344499af4fdc0c7d4f793909d53b.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
    llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index e0d60f605964f..32035c471f744 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -138,6 +138,8 @@ class UnwindLocation {
     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.

diff  --git a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
index bdad0b5ad7a5a..671c7277b629f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/LowLevel/DWARFCFIProgram.h
@@ -254,12 +254,6 @@ class CFIProgram {
   /// 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 @@ class CFIProgram {
     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


        


More information about the llvm-commits mailing list