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/FunctionGen.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/CodeGen/FunctionGen.cc') diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index 57454b1..2e5a704 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -26,7 +26,6 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vectorsetName(ArgName); if (IsRef) { - NamedValues[ArgName] = ArgVal; Symbols[ArgName] = {ArgVal, ArgTypeStr, false}; continue; } @@ -36,7 +35,6 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector OldNamedValues = NamedValues; std::map OldSymbols = Symbols; - NamedValues.clear(); Symbols.clear(); createArgumentAllocas(TheFunction, Proto->getArgs()); @@ -115,7 +111,6 @@ Function *FunctionGen::emitFunctionDef(FunctionDefAST *FuncAST, } } - NamedValues = OldNamedValues; Symbols = OldSymbols; return TheFunction; } -- cgit v1.3.1-4-g156e