feat(furc/IR): add global variables

This commit is contained in:
2026-08-18 00:15:43 +02:00
parent 56ea4ba2ab
commit 136663aeab
+4 -2
View File
@@ -22,6 +22,7 @@ struct ir_operand {
Integer = 0, Integer = 0,
Register, Register,
Variable, Variable,
Global,
Function, Function,
Block, Block,
BlockPair, BlockPair,
@@ -34,6 +35,7 @@ struct ir_operand {
std::uint64_t ver : 10; std::uint64_t ver : 10;
} reg; } reg;
std::uint16_t variable; std::uint16_t variable;
std::uint16_t global;
std::uint64_t function; std::uint64_t function;
std::uint64_t block; std::uint64_t block;
struct block_pair_s { struct block_pair_s {
@@ -172,7 +174,7 @@ struct ir_module_variable : ir_variable {
std::uint16_t name; 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 { struct ir_function_variable : ir_variable {
@@ -181,7 +183,7 @@ struct ir_function_variable : ir_variable {
std::uint64_t name; 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 { struct ir_scope {