aboutsummaryrefslogtreecommitdiff
path: root/include/cps/CodeGen.h
diff options
context:
space:
mode:
author_ov4 <hausemasterstream@gmail.com>2026-02-02 08:45:01 +0000
committer_ov4 <hausemasterstream@gmail.com>2026-02-02 08:45:01 +0000
commit419420770c4545ea4010047ef2153004d4700eed (patch)
treebd19eed681dbb68ecb501b6cfc220c42a9803ef3 /include/cps/CodeGen.h
parentecc0fc463ba54dd0cbe33bc14415f432eaa959de (diff)
Added REAL and BOOLEAN types, DIV and MOD operators
Diffstat (limited to 'include/cps/CodeGen.h')
-rw-r--r--include/cps/CodeGen.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h
index 85f605f..df9eef4 100644
--- a/include/cps/CodeGen.h
+++ b/include/cps/CodeGen.h
@@ -5,6 +5,12 @@
#include "cps/AST.h"
#include "cps/RuntimeCheck.h"
#include "cps/FunctionGen.h"
+
+#include "cps/IntegerHandler.h"
+#include "cps/RealHandler.h"
+#include "cps/BooleanHandler.h"
+#include "cps/ArithmeticHandler.h"
+
#include <map>
#include <memory>
@@ -22,10 +28,23 @@ class CodeGen {
std::unique_ptr<RuntimeCheck> RuntimeChecker;
std::unique_ptr<FunctionGen> FuncGen;
+ std::unique_ptr<IntegerHandler> IntHandler;
+ std::unique_ptr<RealHandler> RealHelper;
+ std::unique_ptr<BooleanHandler> BoolHandler;
+ std::unique_ptr<ArithmeticHandler> ArithHandler;
+
llvm::FunctionCallee PrintfFunc;
llvm::FunctionCallee ScanfFunc;
- llvm::Value *PrintfFormatStr;
- llvm::Value *ScanfFormatStr;
+
+ llvm::Value *PrintfFormatStr; // %lld\n
+ llvm::Value *PrintfFloatFormatStr; // %f\n
+ llvm::Value *PrintfStringFormatStr; // %s\n
+
+ llvm::Value *ScanfFormatStr; // %lld
+ llvm::Value *ScanfFloatFormatStr; // %lf
+
+ llvm::Value *TrueStr; // "TRUE"
+ llvm::Value *FalseStr; // "FALSE"
void SetupExternalFunctions();
llvm::AllocaInst *CreateEntryBlockAlloca(llvm::Function *TheFunction, const std::string &VarName);