diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-06-25 17:29:45 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-06-25 17:29:45 -0400 |
commit | 0d8932e96934dbeb0f1e21872693ca833a64341f (patch) | |
tree | 93c95a0bd94f143362144d8a0a7704a797eb8ac5 /main.cpp | |
parent | b16e418091bad151ed064b56f6c4d195242044d7 (diff) |
take env off stack; only save locals for recursion
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -53,7 +53,9 @@ int main() auto envtype = llvm::VectorType::get(llvmState.inttype, ThunkAST::envidx, false); auto [t0, _] = Var::lookup("__t0"); llvmState.builder.SetInsertPoint(entry); - auto env = llvmState.builder.CreateAlloca(envtype, nullptr); + auto zerovec = llvm::ConstantVector::get(llvm::ArrayRef(llvmState.zero)); + auto env = new llvm::GlobalVariable(llvmState.modul, envtype, false, + llvm::GlobalValue::InternalLinkage, zerovec, "env"); llvmState.builder.CreateCall(llvmState.ftype, t0, llvm::ArrayRef<llvm::Value *> {env}); llvmState.builder.CreateRetVoid(); |