mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +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
|
||||
// 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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user