From 4dd85fd6ecd9a67e5c2b68380873e6e114714355 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 05:30:57 +0000 Subject: feat(memory): add tracked MALLOC and FREE builtins Co-Authored-By: Claude Fable 5.1 --- include/cps/CodeGen.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 8f84004..94aacb7 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -22,6 +22,7 @@ namespace cps { class ArrayHandler; class FileHandler; +class MemoryHandler; class ExceptionHandler; class CastExprAST; @@ -52,6 +53,7 @@ class CodeGen { std::unique_ptr StrHandler; std::unique_ptr StrConvHandler; std::unique_ptr Files; + std::unique_ptr Memory; llvm::FunctionCallee PrintfFunc; llvm::FunctionCallee ScanfFunc; @@ -106,6 +108,7 @@ class CodeGen { bool emitLValue(ExprAST *E, LValueInfo &Out); // The rvalue read: load + the STRING null->"" guard. llvm::Value *loadFromLValue(const LValueInfo &LV); + llvm::Value *emitAllocationSize(ExprAST *Expr); llvm::Value *emitCall(const std::string &Callee, const std::vector> &ArgExprs, int Line); bool marshalCallArgs(const std::string &Callee, -- cgit v1.3.1-4-g156e