From e0c77d80585428818c32886eb8c26755ea8ed159 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 1 Aug 2026 18:17:33 +0800 Subject: [CodeGen] Track debug instruction identities Add monotonic MIR debug instruction numbers and structured value substitutions. Verify live number uniqueness, meta-instruction exclusion, substitution graph integrity, and target subregister references while preserving debug identities during cloning. --- backend/include/rcc/CodeGen/MachineFunction.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backend/include/rcc/CodeGen/MachineFunction.h') diff --git a/backend/include/rcc/CodeGen/MachineFunction.h b/backend/include/rcc/CodeGen/MachineFunction.h index c067ee1..8addd4e 100644 --- a/backend/include/rcc/CodeGen/MachineFunction.h +++ b/backend/include/rcc/CodeGen/MachineFunction.h @@ -16,6 +16,7 @@ #include "rcc/Support/Error.h" #include +#include #include #include #include @@ -176,6 +177,8 @@ public: private: MachineFunction(std::string Name, MachineFunctionStableID StableID); + [[nodiscard]] Expected allocateDebugInstrNumber(); + void observeDebugInstrNumber(std::uint32_t Number) noexcept; std::string Name; MachineFunctionStableID StableID; @@ -195,6 +198,7 @@ private: std::vector AllMemOperands; StableIDGenerator BlockIDGenerator; StableIDGenerator InstrIDGenerator; + std::uint32_t DebugInstrNumberingCount = 0; std::unique_ptr Arena; friend class MachineBasicBlock; -- cgit v1.2.3