mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-16 10:52:22 -07:00
Merge pull request #1395 from hdooley/master
factor out alloca generation into a helper
This commit is contained in:
@@ -410,12 +410,10 @@ lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bool allow_loc
|
||||
// NOTE(bill, 2020-06-08): This is a bit of a hack but a "constant" slice needs
|
||||
// its backing data on the stack
|
||||
lbProcedure *p = m->curr_procedure;
|
||||
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
|
||||
|
||||
LLVMTypeRef llvm_type = lb_type(m, t);
|
||||
array_data = LLVMBuildAlloca(p->builder, llvm_type, "");
|
||||
LLVMSetAlignment(array_data, 16); // TODO(bill): Make this configurable
|
||||
LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
|
||||
|
||||
array_data = llvm_alloca(p, llvm_type, 16);
|
||||
|
||||
LLVMBuildStore(p->builder, backing_array.value, array_data);
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user