From 8c2a2b8f9b3f495f329b2ca3c2759e076f9554fd Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:26:30 +0000 Subject: refactor(codegen): remove dead parameters, fields and branches Drop the never-read StackObject::IsCopy flag and registerStackObject parameter, the unused NewExprAST forward declaration, the unused Ret parameter of FunctionGen::emitReturn and CG parameter of ArrayHandler::loadElement, unused includes, and the coerceValueToType early returns already covered by the exact LLVM type check (builtin kinds always map to double/i64/i1/i8). Co-Authored-By: Claude Opus 5.5 --- include/cps/CodeGen.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 6477406..73068bf 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -24,7 +24,6 @@ class FileHandler; class MemoryHandler; class ExceptionHandler; class CastExprAST; -class NewExprAST; class TemplateDeclAST; class ClassTypeDeclAST; @@ -97,12 +96,11 @@ class CodeGen { llvm::AllocaInst *Alive; llvm::AllocaInst *Count; // Non-null for an array; Addr then holds its buffer pointer. int Line; - bool IsCopy; bool Temporary = false; }; std::vector StackObjects; size_t registerStackObject(llvm::Value *Addr, const std::string &TypeName, int Line, - bool IsArray = false, bool IsCopy = false); + bool IsArray = false); void activateStackObject(size_t Index, llvm::Value *Count = nullptr); void emitStackObjectCleanup(const StackObject &Object); void finishStackObjects(llvm::Function *F); -- cgit v1.3.1-4-g156e