diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 08:34:42 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 08:34:42 +0000 |
| commit | abd56ef20bc8061bbecec29edd1301d324c2cb34 (patch) | |
| tree | 8da9a14372a60d4df8bf58693c62c187765e7240 /lib/CodeGen/FunctionGen.cc | |
| parent | 59e3c50bcd58130e81e1f57b21d6e57b4d4aba6d (diff) | |
feat(classes): destroy stack objects at scope exit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index e344410..9d9f60d 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -89,6 +89,7 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector<ParamDecl IRBuilder<> TmpB(&F->getEntryBlock(), F->getEntryBlock().begin()); AllocaInst *Alloca = TmpB.CreateAlloca(ArgType, nullptr, P.Name); + // Shallow BYVAL copy. The common lifetime hook is the future copy-constructor point. Builder.CreateStore(ArgVal, Alloca); const TypeInfo *Info = Types.resolve(P.TypeName); if (Info && Info->IsClass) { @@ -98,6 +99,7 @@ void FunctionGen::createArgumentAllocas(Function *F, const std::vector<ParamDecl } else { Symbols[P.Name] = {Alloca, P.TypeName, false}; } + if (RegisterCopy) RegisterCopy(Alloca, P.TypeName, P.Line); } } |
