From 1749b2b4a3e55db7c9bed95376f99b7f07932b49 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 26 Jul 2026 12:15:33 +0000 Subject: refactor: drop per-type micro handlers and the parallel NamedValues map Integer/Real/Boolean/CharHandler carried only five one-line LLVM API wrappers (now inlined at their call sites in CodeGen.cc) plus dead emitDeclare methods that violated the documented two-table lock-step invariant. StringHandler::emitDeclare (also dead) and its NamedValues reference go too. With the dead writers gone, NamedValues held no information not already in Symbols[].Storage, so the parallel map is removed: getNamedValue reads Symbols, ArrayHandler/FunctionGen take one table, and function bodies save/restore a single map. Behavior unchanged. Co-Authored-By: Claude Fable 5 --- include/cps/CodeGen.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index def7395..4124e65 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -7,12 +7,8 @@ #include "cps/FunctionGen.h" #include "cps/TypeSystem.h" -#include "cps/IntegerHandler.h" -#include "cps/RealHandler.h" -#include "cps/BooleanHandler.h" #include "cps/ArithmeticHandler.h" #include "cps/StringHandler.h" -#include "cps/CharHandler.h" #include "cps/StringConversionHandler.h" #include @@ -27,20 +23,15 @@ class CodeGen { std::unique_ptr TheContext; std::unique_ptr TheModule; std::unique_ptr> Builder; - std::map NamedValues; std::map Symbols; std::unique_ptr Types; - + std::unique_ptr Arrays; std::unique_ptr RuntimeChecker; std::unique_ptr FuncGen; - std::unique_ptr IntHandler; - std::unique_ptr RealHelper; - std::unique_ptr BoolHandler; std::unique_ptr ArithHandler; std::unique_ptr StrHandler; - std::unique_ptr ChrHandler; std::unique_ptr StrConvHandler; llvm::FunctionCallee PrintfFunc; -- cgit v1.3.1-4-g156e