mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
review feedback
This commit is contained in:
@@ -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
|
// NOTE(bill, 2020-06-08): This is a bit of a hack but a "constant" slice needs
|
||||||
// its backing data on the stack
|
// its backing data on the stack
|
||||||
lbProcedure *p = m->curr_procedure;
|
lbProcedure *p = m->curr_procedure;
|
||||||
LLVMPositionBuilderAtEnd(p->builder, p->decl_block->block);
|
|
||||||
|
|
||||||
LLVMTypeRef llvm_type = lb_type(m, t);
|
LLVMTypeRef llvm_type = lb_type(m, t);
|
||||||
|
|
||||||
array_data = llvm_alloca(p, llvm_type, 16);
|
array_data = llvm_alloca(p, llvm_type, 16);
|
||||||
|
|||||||
@@ -217,8 +217,11 @@ LLVMValueRef llvm_one(lbModule *m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLVMValueRef llvm_alloca(lbProcedure *p, LLVMTypeRef llvm_type, isize alignment, char const* name) {
|
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);
|
LLVMValueRef val = LLVMBuildAlloca(p->builder, llvm_type, name);
|
||||||
LLVMSetAlignment(val, cast(unsigned int)alignment);
|
LLVMSetAlignment(val, cast(unsigned int)alignment);
|
||||||
|
|
||||||
LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
|
LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
@@ -2273,7 +2276,6 @@ general_end:;
|
|||||||
return loaded_val;
|
return loaded_val;
|
||||||
} else {
|
} else {
|
||||||
GB_ASSERT(p->decl_block != p->curr_block);
|
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));
|
i64 max_align = gb_max(lb_alignof(src_type), lb_alignof(dst_type));
|
||||||
max_align = gb_max(max_align, 4);
|
max_align = gb_max(max_align, 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user