aboutsummaryrefslogtreecommitdiff
path: root/include/cps/CodeGen.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 03:55:56 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 03:58:26 +0000
commita7b63b8f909f0c17894a9da25c6b274f46dcd0c7 (patch)
tree3fe56c767d3bae81d6db79d899a0237db56a3fe7 /include/cps/CodeGen.h
parente717664c749cf237479147ddecd70a39fc3426f2 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/CodeGen.h')
-rw-r--r--include/cps/CodeGen.h5
1 files changed, 5 insertions, 0 deletions
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<llvm::LLVMContext> TheContext;
@@ -113,6 +114,10 @@ class CodeGen {
std::vector<size_t> &Transfers);
void transferObjects(const std::vector<size_t> &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<std::optional<SymbolInfo>> Saved;