From a7b63b8f909f0c17894a9da25c6b274f46dcd0c7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:55:56 +0000 Subject: refactor(codegen): split large emitStmtImpl arms into methods Move the self-contained FunctionDef, INPUT, OUTPUT and READFILE branches of emitStmtImpl into private emitFunctionDefStmt, emitInputStmt, emitOutputStmt and emitReadFileStmt methods. The dispatch order and the branch bodies are unchanged. Co-Authored-By: Claude Opus 5.5 --- include/cps/CodeGen.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 37da034..8f6a57b 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -26,6 +26,7 @@ class ExceptionHandler; class CastExprAST; class TemplateDeclAST; class ClassTypeDeclAST; +class ReadFileStmtAST; class CodeGen { std::unique_ptr TheContext; @@ -113,6 +114,10 @@ class CodeGen { std::vector &Transfers); void transferObjects(const std::vector &Objects); void emitStmtImpl(StmtAST *Stmt); + void emitFunctionDefStmt(FunctionDefAST *FuncDef); + void emitInputStmt(InputStmtAST *In); + void emitOutputStmt(OutputStmtAST *Out); + void emitReadFileStmt(ReadFileStmtAST *Read); struct ConstantScope { unsigned ID; IdentifierMap> Saved; -- cgit v1.3.1-4-g156e