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
|
1651
|
|
|
|
|
|
SPVM_SWITCH_INFO* SPVM_SWITCH_INFO_new(SPVM_COMPILER* compiler) { |
11
|
1651
|
|
|
|
|
|
SPVM_SWITCH_INFO* switch_info = SPVM_ALLOCATOR_alloc_memory_block_permanent(compiler->current_each_compile_allocator, sizeof(SPVM_SWITCH_INFO)); |
12
|
|
|
|
|
|
|
|
13
|
1651
|
|
|
|
|
|
switch_info->case_infos = SPVM_LIST_new_list_permanent(compiler->current_each_compile_allocator, 0); |
14
|
|
|
|
|
|
|
|
15
|
1651
|
|
|
|
|
|
return switch_info; |
16
|
|
|
|
|
|
|
} |