File Coverage

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


line stmt bran cond sub pod time code
1             // Copyright (c) 2023 Yuki Kimoto
2             // MIT License
3              
4             #include "spvm_switch_info.h"
5              
6             #include "spvm_allocator.h"
7             #include "spvm_compiler.h"
8             #include "spvm_list.h"
9              
10 1675           SPVM_SWITCH_INFO* SPVM_SWITCH_INFO_new(SPVM_COMPILER* compiler) {
11 1675           SPVM_SWITCH_INFO* switch_info = SPVM_ALLOCATOR_alloc_memory_block_permanent(compiler->current_each_compile_allocator, sizeof(SPVM_SWITCH_INFO));
12            
13 1675           switch_info->case_infos = SPVM_LIST_new_list_permanent(compiler->current_each_compile_allocator, 0);
14            
15 1675           return switch_info;
16             }