From a8a9d7d926202450645deae872d4d9dc11d63215 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 2 Aug 2026 03:37:46 +0800 Subject: [CodeGen] Model machine debug metadata Replace marker-based metadata operands with scoped references and inline DIExpression values. Add structured DILocation chains, instruction debug attachments, stack variable records, and entry values with unified verification, builder support, and deterministic cloning. --- backend/include/rcc/CodeGen/MachineInstr.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'backend/include/rcc/CodeGen/MachineInstr.h') diff --git a/backend/include/rcc/CodeGen/MachineInstr.h b/backend/include/rcc/CodeGen/MachineInstr.h index 78d48cb..69d7dd7 100644 --- a/backend/include/rcc/CodeGen/MachineInstr.h +++ b/backend/include/rcc/CodeGen/MachineInstr.h @@ -121,6 +121,16 @@ public: Location.reset(); } + [[nodiscard]] const std::optional &debugLocation() const noexcept { + return DebugLocation; + } + + [[nodiscard]] Expected setDebugLocation(MachineDebugLocation NewLocation); + + void clearDebugLocation() noexcept { + DebugLocation.reset(); + } + [[nodiscard]] std::optional origin() const noexcept { return Origin; } @@ -164,6 +174,7 @@ private: std::vector MemOperands; MachineInstrFlags Flags; std::optional Location; + std::optional DebugLocation; std::optional Origin; std::uint32_t DebugInstrNumber = 0; -- cgit v1.2.3