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 --- lib/CodeGen/CharHandler.cc | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 lib/CodeGen/CharHandler.cc (limited to 'lib/CodeGen/CharHandler.cc') diff --git a/lib/CodeGen/CharHandler.cc b/lib/CodeGen/CharHandler.cc deleted file mode 100644 index 5e9b502..0000000 --- a/lib/CodeGen/CharHandler.cc +++ /dev/null @@ -1,15 +0,0 @@ -#include "cps/CharHandler.h" - -using namespace llvm; -using namespace cps; - -CharHandler::CharHandler(LLVMContext &Ctx, IRBuilder<> &B, llvm::Module &M) - : Context(Ctx), Builder(B), Module(M) {} - -Value *CharHandler::emitAsc(Value *CharVal) { - return Builder.CreateZExt(CharVal, Type::getInt32Ty(Context), "asc_val"); -} - -Value *CharHandler::emitChr(Value *IntVal) { - return Builder.CreateTrunc(IntVal, Type::getInt8Ty(Context), "chr_val"); -} -- cgit v1.3.1-4-g156e