refactor(IR)!: change IR block structure

It now requires an exit instruction.
This commit is contained in:
2026-06-01 18:27:36 +02:00
parent de49674f81
commit 62619cd0bc
5 changed files with 45 additions and 11 deletions
+7
View File
@@ -35,6 +35,13 @@ public:
void visit(const ast::binop_expression_node& node) override;
void visit(const ast::var_assign_expression_node& node) override;
private:
template <typename T, typename... Args>
void push(Args&&... args) {
if (!m_currentBlock->emplace<T>(std::forward<Args>(args)...)) {
throw std::runtime_error("block exited too soon");
}
}
furlang::ir::block_index push_block();
private:
furlang::ir::module m_module;