// 语句翻译模块: // - 处理 if/while/return 等控制流构造 // - 负责基本块创建、分支跳转与控制流收束 #include "irgen/IRGen.h" #include #include "ast/AstNodes.h" #include "ir/IR.h" void IRGenImpl::GenStmt(const ast::Stmt& stmt) { if (auto ret = dynamic_cast(&stmt)) { ir::Value* v = GenExpr(*ret->value); builder_.CreateRet(v); return; } throw std::runtime_error("[irgen] 暂不支持的语句类型"); }