From 6e09614afd2a589690d107b41308f6fe6614c266 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 1 Aug 2026 17:58:12 +0800 Subject: [CodeGen] Add machine function records Represent callee-saved registers, call-site information, called globals, and prefetch targets in the core MachineIR model. Verify target and instruction references and remap StableIDs during explicit function cloning. --- backend/include/rcc/CodeGen/MachineFunction.h | 10 ++++++++++ 1 file changed, 10 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 4ed660d..c067ee1 100644 --- a/backend/include/rcc/CodeGen/MachineFunction.h +++ b/backend/include/rcc/CodeGen/MachineFunction.h @@ -8,6 +8,7 @@ #include "rcc/CodeGen/MachineFrameInfo.h" #include "rcc/CodeGen/MachineFunctionAttributes.h" #include "rcc/CodeGen/MachineFunctionProperties.h" +#include "rcc/CodeGen/MachineFunctionRecords.h" #include "rcc/CodeGen/MachineJumpTableInfo.h" #include "rcc/CodeGen/MachineRegisterInfo.h" #include "rcc/CodeGen/StableID.h" @@ -98,6 +99,14 @@ public: return Attributes; } + [[nodiscard]] MachineFunctionRecords &records() noexcept { + return Records; + } + + [[nodiscard]] const MachineFunctionRecords &records() const noexcept { + return Records; + } + [[nodiscard]] const TargetFunctionState &targetState() const noexcept { return TargetState; } @@ -176,6 +185,7 @@ private: MachineJumpTableInfo JumpTables; MachineFunctionProperties Properties; MachineFunctionAttributes Attributes; + MachineFunctionRecords Records; TargetFunctionState TargetState; MachineCompilationStatus CompilationStatus; MachineBasicBlock *FirstBlock = nullptr; -- cgit v1.2.3