diff options
| author | _ov4 <ov4@ov4.org> | 2026-07-26 12:15:33 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-07-26 12:15:33 +0000 |
| commit | 1749b2b4a3e55db7c9bed95376f99b7f07932b49 (patch) | |
| tree | fca50620a4e6b46609f18abaf205416ea245dce8 /lib/CodeGen/FunctionGen.cc | |
| parent | b9b7f048b0874df0f034f6b1e15e1a4ee2131475 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 5 |
1 files changed, 0 insertions, 5 deletions
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::vector<std::tupl ArgVal->setName(ArgName); if (IsRef) { - NamedValues[ArgName] = ArgVal; Symbols[ArgName] = {ArgVal, ArgTypeStr, false}; continue; } @@ -36,7 +35,6 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector<std::tupl AllocaInst *Alloca = TmpB.CreateAlloca(ArgType, nullptr, ArgName); Builder.CreateStore(ArgVal, Alloca); - NamedValues[ArgName] = Alloca; Symbols[ArgName] = {Alloca, ArgTypeStr, false}; } } @@ -96,9 +94,7 @@ Function *FunctionGen::emitFunctionDef(FunctionDefAST *FuncAST, BasicBlock *BB = BasicBlock::Create(Context, "entry", TheFunction); Builder.SetInsertPoint(BB); - std::map<std::string, llvm::Value*> OldNamedValues = NamedValues; std::map<std::string, SymbolInfo> 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; } |
