aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MachineFunction.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 18:17:33 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 18:17:33 +0800
commite0c77d80585428818c32886eb8c26755ea8ed159 (patch)
treef1d79404cb767c91b9aed3ad1a7709a628b3860f /backend/include/rcc/CodeGen/MachineFunction.h
parent6e09614afd2a589690d107b41308f6fe6614c266 (diff)
downloadrcc-project-e0c77d80585428818c32886eb8c26755ea8ed159.tar.gz
rcc-project-e0c77d80585428818c32886eb8c26755ea8ed159.tar.xz
[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.
Diffstat (limited to 'backend/include/rcc/CodeGen/MachineFunction.h')
-rw-r--r--backend/include/rcc/CodeGen/MachineFunction.h4
1 files changed, 4 insertions, 0 deletions
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 <cstddef>
+#include <cstdint>
#include <memory>
#include <span>
#include <string>
@@ -176,6 +177,8 @@ public:
private:
MachineFunction(std::string Name, MachineFunctionStableID StableID);
+ [[nodiscard]] Expected<std::uint32_t> allocateDebugInstrNumber();
+ void observeDebugInstrNumber(std::uint32_t Number) noexcept;
std::string Name;
MachineFunctionStableID StableID;
@@ -195,6 +198,7 @@ private:
std::vector<const MachineMemOperand *> AllMemOperands;
StableIDGenerator<MachineBlockStableID> BlockIDGenerator;
StableIDGenerator<MachineInstrStableID> InstrIDGenerator;
+ std::uint32_t DebugInstrNumberingCount = 0;
std::unique_ptr<MachineArena> Arena;
friend class MachineBasicBlock;