From 419420770c4545ea4010047ef2153004d4700eed Mon Sep 17 00:00:00 2001 From: _ov4 Date: Mon, 2 Feb 2026 08:45:01 +0000 Subject: Added REAL and BOOLEAN types, DIV and MOD operators --- include/cps/CodeGen.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'include/cps/CodeGen.h') 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 #include @@ -22,10 +28,23 @@ class CodeGen { std::unique_ptr RuntimeChecker; std::unique_ptr FuncGen; + std::unique_ptr IntHandler; + std::unique_ptr RealHelper; + std::unique_ptr BoolHandler; + std::unique_ptr 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); -- cgit v1.3.1-4-g156e