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

AmirHossein PashaeeHir via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 12:42:19 PDT 2025


https://github.com/amsen20 updated https://github.com/llvm/llvm-project/pull/145804

>From 3646d6eb29d10f8a23a68c8b267fcf7b82e0c820 Mon Sep 17 00:00:00 2001
From: Amirhossein Pashaeehir <amirhosseinp at google.com>
Date: Wed, 25 Jun 2025 22:23:35 +0000
Subject: [PATCH] Make unwind info internals more accessible

---
 llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h | 12 ++++++------
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
index 1d89ac3578c10..79a2be7ef2584 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h
@@ -112,12 +112,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));
@@ -144,6 +138,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
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index 3b367009a379d..89d12437a7d31 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.



More information about the llvm-commits mailing list