diff options
| author | gingerBill <bill@gingerbill.org> | 2023-03-16 15:16:17 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-03-16 15:16:17 +0000 |
| commit | 8dc70f797cf8b4315d689ce94ab004faadb015b7 (patch) | |
| tree | 5429d9d7aa8a6071761b993de0a25ff6be0c84e7 /src/llvm_backend_general.cpp | |
| parent | 2cf8a9da6f7becfe7c8d279af4cc81b02dd706b6 (diff) | |
Increase use of `temporary_allocator()` where possible
Diffstat (limited to 'src/llvm_backend_general.cpp')
| -rw-r--r-- | src/llvm_backend_general.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index 52ea4f399..aa887418f 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -496,6 +496,8 @@ gb_internal void lb_emit_bounds_check(lbProcedure *p, Token token, lbValue index return; } + TEMPORARY_ALLOCATOR_GUARD(); + index = lb_emit_conv(p, index, t_int); len = lb_emit_conv(p, len, t_int); @@ -503,7 +505,7 @@ gb_internal void lb_emit_bounds_check(lbProcedure *p, Token token, lbValue index lbValue line = lb_const_int(p->module, t_i32, token.pos.line); lbValue column = lb_const_int(p->module, t_i32, token.pos.column); - auto args = array_make<lbValue>(permanent_allocator(), 5); + auto args = array_make<lbValue>(temporary_allocator(), 5); args[0] = file; args[1] = line; args[2] = column; @@ -521,6 +523,8 @@ gb_internal void lb_emit_matrix_bounds_check(lbProcedure *p, Token token, lbValu return; } + TEMPORARY_ALLOCATOR_GUARD(); + row_index = lb_emit_conv(p, row_index, t_int); column_index = lb_emit_conv(p, column_index, t_int); row_count = lb_emit_conv(p, row_count, t_int); @@ -530,7 +534,7 @@ gb_internal void lb_emit_matrix_bounds_check(lbProcedure *p, Token token, lbValu lbValue line = lb_const_int(p->module, t_i32, token.pos.line); lbValue column = lb_const_int(p->module, t_i32, token.pos.column); - auto args = array_make<lbValue>(permanent_allocator(), 7); + auto args = array_make<lbValue>(temporary_allocator(), 7); args[0] = file; args[1] = line; args[2] = column; @@ -1336,6 +1340,7 @@ gb_internal void lb_emit_store_union_variant(lbProcedure *p, lbValue parent, lbV gb_internal void lb_clone_struct_type(LLVMTypeRef dst, LLVMTypeRef src) { + TEMPORARY_ALLOCATOR_GUARD(); unsigned field_count = LLVMCountStructElementTypes(src); LLVMTypeRef *fields = gb_alloc_array(temporary_allocator(), LLVMTypeRef, field_count); LLVMGetStructElementTypes(src, fields); |