File Coverage

lib/SPVM/Builder/src/spvm_method.c
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 6 6 100.0


line stmt bran cond sub pod time code
1             // Copyright (c) 2023 Yuki Kimoto
2             // MIT License
3              
4             #include
5              
6             #include "spvm_method.h"
7              
8             #include "spvm_allocator.h"
9             #include "spvm_compiler.h"
10             #include "spvm_var_decl.h"
11             #include "spvm_list.h"
12             #include "spvm_op.h"
13             #include "spvm_type.h"
14             #include "spvm_basic_type.h"
15             #include "spvm_opcode_list.h"
16              
17 310960           SPVM_METHOD* SPVM_METHOD_new(SPVM_COMPILER* compiler) {
18 310960           SPVM_METHOD* method = SPVM_ALLOCATOR_alloc_memory_block_permanent(compiler->current_each_compile_allocator, sizeof(SPVM_METHOD));
19            
20 310960           method->var_decls = SPVM_LIST_new_list_permanent(compiler->current_each_compile_allocator, 0);
21 310960           method->anon_method_fields = SPVM_LIST_new_list_permanent(compiler->current_each_compile_allocator, 0);
22            
23 310960           method->opcode_list = SPVM_OPCODE_LIST_new(compiler);
24            
25 310960           return method;
26             }