review feedback

This commit is contained in:
Henry Dooley
2021-12-28 10:50:34 -06:00
parent 069c05669f
commit 865d88dd56
2 changed files with 3 additions and 3 deletions

View File

@@ -410,8 +410,6 @@ 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 = llvm_alloca(p, llvm_type, 16);

View File

@@ -217,8 +217,11 @@ LLVMValueRef llvm_one(lbModule *m) {
}
LLVMValueRef llvm_alloca(lbProcedure *p, LLVMTypeRef llvm_type, isize alignment, char const* name) {
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
LLVMValueRef val = LLVMBuildAlloca(p->builder, llvm_type, name);
LLVMSetAlignment(val, cast(unsigned int)alignment);
LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
return val;
@@ -2273,7 +2276,6 @@ general_end:;
return loaded_val;
} else {
GB_ASSERT(p->decl_block != p->curr_block);
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
i64 max_align = gb_max(lb_alignof(src_type), lb_alignof(dst_type));
max_align = gb_max(max_align, 4);