From 136663aeabfd8f7f05f94e1b4b3f54b576e252ea Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Tue, 18 Aug 2026 00:15:43 +0200 Subject: [PATCH] feat(furc/IR): add global variables --- furc/include/furc/middle/ir.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/furc/include/furc/middle/ir.hpp b/furc/include/furc/middle/ir.hpp index 255462a..4180b72 100644 --- a/furc/include/furc/middle/ir.hpp +++ b/furc/include/furc/middle/ir.hpp @@ -22,6 +22,7 @@ struct ir_operand { Integer = 0, Register, Variable, + Global, Function, Block, BlockPair, @@ -34,6 +35,7 @@ struct ir_operand { std::uint64_t ver : 10; } reg; std::uint16_t variable; + std::uint16_t global; std::uint64_t function; std::uint64_t block; struct block_pair_s { @@ -172,7 +174,7 @@ struct ir_module_variable : ir_variable { std::uint16_t name; - ir_operand operand() const final { return { ir_operand::Variable, name }; } + ir_operand operand() const final { return { ir_operand::Global, name }; } }; struct ir_function_variable : ir_variable { @@ -181,7 +183,7 @@ struct ir_function_variable : ir_variable { std::uint64_t name; - ir_operand operand() const final { return { ir_operand::Register, name }; } + ir_operand operand() const final { return { ir_operand::Variable, name }; } }; struct ir_scope {