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/CharHandler.h | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 include/cps/CharHandler.h (limited to 'include/cps/CharHandler.h') diff --git a/include/cps/CharHandler.h b/include/cps/CharHandler.h deleted file mode 100644 index 03c86e7..0000000 --- a/include/cps/CharHandler.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "llvm/IR/IRBuilder.h" -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/Module.h" - -namespace cps { - -class CharHandler { - llvm::LLVMContext &Context; - llvm::IRBuilder<> &Builder; - llvm::Module &Module; - -public: - CharHandler(llvm::LLVMContext &Ctx, llvm::IRBuilder<> &B, llvm::Module &M); - - // ASC(ThisChar: CHAR) RETURNS INTEGER - llvm::Value *emitAsc(llvm::Value *CharVal); - - // CHR(x: INTEGER) RETURNS CHAR - llvm::Value *emitChr(llvm::Value *IntVal); -}; - -} // namespace cps -- cgit v1.3.1-4-g156e