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/StringHandler.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/cps/StringHandler.h') diff --git a/include/cps/StringHandler.h b/include/cps/StringHandler.h index 7226b85..0af0cc7 100644 --- a/include/cps/StringHandler.h +++ b/include/cps/StringHandler.h @@ -2,7 +2,6 @@ #include "llvm/IR/IRBuilder.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" -#include #include namespace cps { @@ -11,7 +10,6 @@ class StringHandler { llvm::LLVMContext &Context; llvm::IRBuilder<> &Builder; llvm::Module &Module; - std::map &NamedValues; llvm::FunctionCallee MallocFunc; llvm::FunctionCallee StrLenFunc; @@ -22,11 +20,9 @@ class StringHandler { llvm::FunctionCallee ToLowerFunc; public: - StringHandler(llvm::LLVMContext &Ctx, llvm::IRBuilder<> &B, llvm::Module &M, - std::map &NV); - + StringHandler(llvm::LLVMContext &Ctx, llvm::IRBuilder<> &B, llvm::Module &M); + void setupExternalFunctions(); - void emitDeclare(const std::string &Name); llvm::Value *createLiteral(const std::string &Val); llvm::Value *emitLength(llvm::Value *Str); -- cgit v1.3.1-4-g156e