aboutsummaryrefslogtreecommitdiff
path: root/include/cps/CodeGen.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-16 10:04:27 +0000
committer_ov4 <ov4@ov4.org>2026-10-16 10:04:27 +0000
commit45c9d37eb27d204a6202b33cb37e890af0171357 (patch)
treedba23170b16053c5e1ec4bf78efc2a533cb94a4e /include/cps/CodeGen.h
parent522742e9df7fc5ac596ce4aa53d41b31e4f6a030 (diff)
feat(control-flow): implement ordered CASE OF matching
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/CodeGen.h')
-rw-r--r--include/cps/CodeGen.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h
index 72b96c6..4259d63 100644
--- a/include/cps/CodeGen.h
+++ b/include/cps/CodeGen.h
@@ -70,13 +70,17 @@ class CodeGen {
llvm::Value *convertNumericValue(llvm::Value *Val, const TypeInfo *Source,
const TypeInfo *Target);
llvm::Value *emitCast(CastExprAST *Cast);
- llvm::Value *emitCBinaryOp(BinaryExprAST *Bin, const TypeInfo *Left, const TypeInfo *Right);
+ llvm::Value *emitBinaryOp(int Op, llvm::Value *L, const TypeInfo *LT,
+ llvm::Value *R, const TypeInfo *RT, int Line);
+ llvm::Value *emitCBinaryOp(int Op, llvm::Value *L, const TypeInfo *Left,
+ llvm::Value *R, const TypeInfo *Right, int Line);
void emitCOutput(llvm::Value *Val, const TypeInfo *Info, bool AppendNewline);
void emitCInput(const SymbolInfo *Symbol, const TypeInfo *Info);
// TYPE-system registration (Designator.cc) and operators (TypeCheckGen.cc).
void runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statements);
- llvm::Value *emitUserKindBinaryOp(BinaryExprAST *Bin, const TypeInfo *LT, const TypeInfo *RT);
+ llvm::Value *emitUserKindBinaryOp(int Op, llvm::Value *L, const TypeInfo *LT,
+ llvm::Value *R, const TypeInfo *RT, int Line);
// An addressable location and the pseudocode type stored there.
struct LValueInfo {
@@ -95,6 +99,7 @@ class CodeGen {
void emitDeclareStmt(DeclareStmtAST *Stmt);
void emitOutputValue(llvm::Value *Val, const TypeInfo *TypeInfo, bool AppendNewline = true);
+ void emitCaseStmt(CaseStmtAST *Stmt);
void emitIfStmt(IfStmtAST *Stmt);
void emitTryStmt(TryStmtAST *Stmt);
void emitWhileStmt(WhileStmtAST *Stmt);