From 787f3a7a20958bfa6f231abccc617f4d8de25c4d Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sat, 1 Aug 2026 17:36:40 +0800 Subject: [CodeGen] Add MIR function and block attributes --- backend/include/rcc/CodeGen/MachineBasicBlock.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backend/include/rcc/CodeGen/MachineBasicBlock.h') diff --git a/backend/include/rcc/CodeGen/MachineBasicBlock.h b/backend/include/rcc/CodeGen/MachineBasicBlock.h index ba59160..d82477a 100644 --- a/backend/include/rcc/CodeGen/MachineBasicBlock.h +++ b/backend/include/rcc/CodeGen/MachineBasicBlock.h @@ -3,6 +3,7 @@ #ifndef RCC_CODEGEN_MACHINEBASICBLOCK_H #define RCC_CODEGEN_MACHINEBASICBLOCK_H +#include "rcc/CodeGen/MachineBasicBlockAttributes.h" #include "rcc/CodeGen/MachineIRTypes.h" #include "rcc/CodeGen/Register.h" #include "rcc/CodeGen/StableID.h" @@ -124,6 +125,14 @@ public: return LayoutIndex; } + [[nodiscard]] MachineBasicBlockAttributes &attributes() noexcept { + return Attributes; + } + + [[nodiscard]] const MachineBasicBlockAttributes &attributes() const noexcept { + return Attributes; + } + private: MachineBasicBlock(MachineFunction &OwnerFunction, MachineBlockStableID StableID) : OwnerFunction(&OwnerFunction), StableID(StableID) {} @@ -138,6 +147,7 @@ private: std::vector Predecessors; std::vector Successors; std::vector LiveIns; + MachineBasicBlockAttributes Attributes; std::optional DenseNumber; std::optional LayoutIndex; -- cgit v1.2.3