diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:26:30 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 03:58:26 +0000 |
| commit | 8c2a2b8f9b3f495f329b2ca3c2759e076f9554fd (patch) | |
| tree | 2c86d86d7eb0acba30ec9105f6aa7ac506759ead /lib/CodeGen/ConstructorGen.cc | |
| parent | c062fc71f400df8acc14d06819370229af7e5d54 (diff) | |
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 <cstdio> 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 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/ConstructorGen.cc')
| -rw-r--r-- | lib/CodeGen/ConstructorGen.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/ConstructorGen.cc b/lib/CodeGen/ConstructorGen.cc index dfdfbb5..429138a 100644 --- a/lib/CodeGen/ConstructorGen.cc +++ b/lib/CodeGen/ConstructorGen.cc @@ -70,7 +70,7 @@ Value *CodeGen::copyClassValue(const TypeInfo *Type, Value *Address, if (!checkOperatorAccess(*Copy)) return nullptr; auto *Storage = CreateEntryBlockAlloca(Builder->GetInsertBlock()->getParent(), Type->LLVMType, "copy_object"); - size_t Lifetime = registerStackObject(Storage, Type->Name, DiagnosticLine, false, true); + size_t Lifetime = registerStackObject(Storage, Type->Name, DiagnosticLine); if (Lifetime != size_t(-1)) StackObjects[Lifetime].Temporary = true; Builder->CreateStore(Types->getZeroValue(Type->Name), Storage); for (const auto &[Name, Field] : Type->Record.Fields) { @@ -255,7 +255,7 @@ bool CodeGen::emitDestroy(const std::string &TypeName, Value *Addr, int Line) { } size_t CodeGen::registerStackObject(Value *Addr, const std::string &TypeName, int Line, - bool IsArray, bool IsCopy) { + bool IsArray) { if (!typeNeedsDestruction(TypeName)) return size_t(-1); auto *F = Builder->GetInsertBlock()->getParent(); IRBuilder<> Entry(&F->getEntryBlock(), F->getEntryBlock().begin()); @@ -266,7 +266,7 @@ size_t CodeGen::registerStackObject(Value *Addr, const std::string &TypeName, in Count = Entry.CreateAlloca(Entry.getInt64Ty(), nullptr, "object_count"); Entry.CreateStore(Entry.getInt64(0), Count); } - StackObjects.push_back({Addr, TypeName, Alive, Count, Line, IsCopy}); + StackObjects.push_back({Addr, TypeName, Alive, Count, Line}); // This DECLARE can execute repeatedly, including after a backward loop edge. emitStackObjectCleanup(StackObjects.back()); return StackObjects.size() - 1; |
