aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MachineFunction.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-02 02:56:39 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-02 02:56:39 +0800
commit49d70380a6a95e4039f6b5e5ccce09671d5b4796 (patch)
treec5a265f074ff4fa041b03745cc60218bb9f48a5d /backend/include/rcc/CodeGen/MachineFunction.h
parente0c77d80585428818c32886eb8c26755ea8ed159 (diff)
downloadrcc-project-49d70380a6a95e4039f6b5e5ccce09671d5b4796.tar.gz
rcc-project-49d70380a6a95e4039f6b5e5ccce09671d5b4796.tar.xz
[CodeGen] Add machine metadata graphs
Model ordered function-local metadata tuples with explicit embedded-IR and MachineFunction reference scopes. Preserve slot zero, distinct nodes, forward references, and cyclic graphs while verifying function-local closure and cloning the graph deterministically.
Diffstat (limited to 'backend/include/rcc/CodeGen/MachineFunction.h')
-rw-r--r--backend/include/rcc/CodeGen/MachineFunction.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/MachineFunction.h b/backend/include/rcc/CodeGen/MachineFunction.h
index 8addd4e..7b325d4 100644
--- a/backend/include/rcc/CodeGen/MachineFunction.h
+++ b/backend/include/rcc/CodeGen/MachineFunction.h
@@ -10,6 +10,7 @@
#include "rcc/CodeGen/MachineFunctionProperties.h"
#include "rcc/CodeGen/MachineFunctionRecords.h"
#include "rcc/CodeGen/MachineJumpTableInfo.h"
+#include "rcc/CodeGen/MachineMetadata.h"
#include "rcc/CodeGen/MachineRegisterInfo.h"
#include "rcc/CodeGen/StableID.h"
#include "rcc/CodeGen/TargetFunctionState.h"
@@ -108,6 +109,14 @@ public:
return Records;
}
+ [[nodiscard]] MachineMetadataInfo &metadata() noexcept {
+ return Metadata;
+ }
+
+ [[nodiscard]] const MachineMetadataInfo &metadata() const noexcept {
+ return Metadata;
+ }
+
[[nodiscard]] const TargetFunctionState &targetState() const noexcept {
return TargetState;
}
@@ -189,6 +198,7 @@ private:
MachineFunctionProperties Properties;
MachineFunctionAttributes Attributes;
MachineFunctionRecords Records;
+ MachineMetadataInfo Metadata;
TargetFunctionState TargetState;
MachineCompilationStatus CompilationStatus;
MachineBasicBlock *FirstBlock = nullptr;