diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-01 18:17:33 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-01 18:17:33 +0800 |
| commit | e0c77d80585428818c32886eb8c26755ea8ed159 (patch) | |
| tree | f1d79404cb767c91b9aed3ad1a7709a628b3860f /backend/include/rcc/CodeGen/MachineInstr.h | |
| parent | 6e09614afd2a589690d107b41308f6fe6614c266 (diff) | |
| download | rcc-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/MachineInstr.h')
| -rw-r--r-- | backend/include/rcc/CodeGen/MachineInstr.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/MachineInstr.h b/backend/include/rcc/CodeGen/MachineInstr.h index bcae306..78d48cb 100644 --- a/backend/include/rcc/CodeGen/MachineInstr.h +++ b/backend/include/rcc/CodeGen/MachineInstr.h @@ -9,6 +9,7 @@ #include "rcc/Support/Error.h" #include <cstddef> +#include <cstdint> #include <functional> #include <optional> #include <span> @@ -132,6 +133,17 @@ public: Origin.reset(); } + [[nodiscard]] std::uint32_t debugInstrNumber() const noexcept { + return DebugInstrNumber; + } + + [[nodiscard]] Expected<void> setDebugInstrNumber(std::uint64_t Number); + [[nodiscard]] Expected<std::uint32_t> assignDebugInstrNumber(); + + void clearDebugInstrNumber() noexcept { + DebugInstrNumber = 0; + } + private: MachineInstr(MachineFunction &OwnerFunction, Opcode InstructionOpcode, MachineInstrStableID StableID); @@ -153,6 +165,7 @@ private: MachineInstrFlags Flags; std::optional<SourceLocation> Location; std::optional<OriginID> Origin; + std::uint32_t DebugInstrNumber = 0; friend class MachineArena; friend class MachineBasicBlock; |
