| 1 | package SPVM::Builder::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # This module is used from Makefile.PL via SPVM::Builder::Util::API | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # so this class must be wrote as pure perl. Do not contain XS functions. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1786 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 893 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 893 | ▶ | use Carp 'confess'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 893 | ▶ | use Config; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 893 | ▶ | use File::Path 'mkpath'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 893 | ▶ | use Pod::Usage 'pod2usage'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 893 | ▶ | use Getopt::Long 'GetOptionsFromArray'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 893 | ▶ | use List::Util 'min'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 893 | ▶ | use File::Basename 'dirname', 'basename'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 893 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 893 | ▶ | use Encode 'decode'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 893 | ▶ | use File::Find 'find'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 893 | ▶ | use Time::HiRes (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 893 | ▶ | use Digest::SHA 'sha1_hex'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 893 | ▶ | use Fcntl qw(:flock); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 893 | ▶ | use FindBin; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 893 | ▶ | use Fcntl qw(O_RDONLY); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 893 | ▶ | use Errno; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 895 | ▶ | use File::Temp; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 895 | ▶ | use File::Copy 'move'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 895 | ▶ | use SPVM::Builder::Config; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub get_spvm_header_files { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_header_files: not called CC=2 SCAR=7.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 9 | ▶ | my $builder_dir = &get_builder_dir; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_header_files: called CC=2 SCAR=7.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 9 | my $include_dir = "$builder_dir/include"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | # Get all .h files in the include directory | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 9 | ▶ | my @spvm_header_files = glob("$include_dir/*.h"); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | unless (@spvm_header_files) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | confess("The SPVM header files are not found in the directory '$include_dir'."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | return \@spvm_header_files; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub get_spvm_precompile_source_files { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_precompile_source_files: not called CC=3 SCAR=15.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | my $builder_dir = &get_builder_dir; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_precompile_source_files: called CC=3 SCAR=15.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | my $src_dir = "$builder_dir/src"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | # Specify the required source files | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | my @filenames = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 'spvm_precompile.c', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 'spvm_string_buffer.c', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | my @spvm_precompile_source_files; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | for my $filename (@filenames) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | my $file = "$src_dir/$filename"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (-f $file) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | push @spvm_precompile_source_files, $file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | confess("The SPVM precompile source file '$file' is not found."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | return \@spvm_precompile_source_files; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 75 | ▶ | sub get_spvm_core_source_file_names { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_core_source_file_names: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 9 | ▶ | my @spvm_core_source_file_names = qw( | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_core_source_file_names: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | spvm_allocator.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | spvm_allow.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | spvm_api_allocator.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | spvm_api_arg.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | spvm_api_basic_type.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | spvm_api.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | spvm_api_cfunc.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | spvm_api_class_file.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | spvm_api_class_var.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | spvm_api_compiler.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | spvm_api_field.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | spvm_api_internal.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | spvm_api_method.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | spvm_api_mutex.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | spvm_api_runtime.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | spvm_api_string_buffer.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | spvm_api_type.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | spvm_array_field_access.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | spvm_attribute.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | spvm_basic_type.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | spvm_block.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | spvm_call_method.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | spvm_case_info.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | spvm_check.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | spvm_class_file.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | spvm_class_var_access.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | spvm_class_var.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | spvm_compiler.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | spvm_constant.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | spvm_dumper.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | spvm_field_access.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | spvm_field.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | spvm_hash.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | spvm_interface.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | spvm_list.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | spvm_method.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | spvm_mutex.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | spvm_op.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | spvm_opcode_builder.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | spvm_opcode.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | spvm_opcode_list.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | spvm_precompile.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | spvm_precompile_header_content.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | spvm_runtime.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | spvm_strerror.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | spvm_string_buffer.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | spvm_string.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | spvm_switch_info.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | spvm_toke.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | spvm_type.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | spvm_use.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | spvm_utf8.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | spvm_var.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | spvm_var_decl.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | spvm_version_from.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | spvm_vm.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | spvm_yacc.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | spvm_yacc_util.c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 9 | return \@spvm_core_source_file_names; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 3867 | ▶ | sub slurp_binary { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurp_binary: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 9 | ▶ | my ($file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurp_binary: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 9 | ▶ | open my $fh, '<', $file | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | or confess("Can't open file '$file':$!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 9 | my $content = do { local $/; <$fh> }; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 9 | return $content; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 203 | ▶ | sub slurp_utf8 { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurp_utf8: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 9 | ▶ | my ($file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurp_utf8: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 9 | my $content = &slurp_binary($file); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 9 | $content = decode('UTF-8', $content); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 9 | return $content; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 203 | ▶ | sub file_contains { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_contains: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 9 | ▶ | my ($file, $string) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_contains: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 9 | my $content = &slurp_utf8($file); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 9 | my $contains; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 9 | ▶ | if (index($content, $string) >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 9 | $contains = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 9 | return $contains; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 1691 | ▶ | sub spurt_binary { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
spurt_binary: called CC=11 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 9 | ▶ | my ($output_file, $content, $global_lock_fh) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
spurt_binary: called CC=11 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 9 | ▶ | if ($global_lock_fh) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 9 | ▶ | flock($global_lock_fh, LOCK_EX) or confess "Can't lock global lock file: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 9 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 9 | my $should_write = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 9 | ▶ | if (-f $output_file) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 9 | my $old_content = do { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 9 | ▶ | open my $read_fh, '<:raw', $output_file or die "Can't open for read '$output_file':$!"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 9 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 9 | <$read_fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 9 | ▶ | if ($old_content eq $content) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 9 | $should_write = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 9 | ▶ | if ($should_write) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 9 | my $dir = dirname($output_file); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 9 | mkpath $dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | # Write to a temporary file first | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 9 | my $tmp_file = "$output_file.tmp.$$"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 9 | ▶ | open my $output_fh, '>:raw', $tmp_file | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | or die "Can't open temporary file '$tmp_file':$!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 9 | print $output_fh $content; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 9 | close $output_fh; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | # Atomically replace the target file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 9 | ▶ | move($tmp_file, $output_file) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | or confess("Can't move '$tmp_file' to '$output_file':$!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 9 | my $error = $@; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 9 | ▶ | if ($global_lock_fh) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 9 | flock($global_lock_fh, LOCK_UN); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 9 | ▶ | if ($error) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | confess $error; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 2 | ▶ | sub unindent { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unindent: called CC=3 SCAR=11.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 9 | ▶ | my $str = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unindent: called CC=3 SCAR=11.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 9 | ▶ | my $min = min map { m/^([ \t]*)/; length $1 || () } split "\n", $str; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
length $1 || ()
length $1 || ()
MC/DC0%0/2
length $1 || ()
length $1
()
MC/DC0%0/2
length $1 || ()
length $1
()
Truth table0%0/3
A || B
A= length $1B= ()
Truth table66%2/3
A || B
A= length $1B= ()
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 9 | ▶ | $str =~ s/^[ \t]{0,$min}//gm if $min; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 9 | return $str; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 2 | ▶ | sub extract_usage { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
extract_usage: called CC=2 SCAR=9.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 9 | ▶ | my $file = @_ ? "$_[0]" : (caller)[1]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
extract_usage: called CC=2 SCAR=9.2
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | open my $handle, '>', \my $output; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | pod2usage -exitval => 'noexit', -input => $file, -output => $handle, -verbose => 99, -sections => "Usage"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | $output =~ s/^.*\n|\n$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | $output =~ s/\n$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | return SPVM::Builder::Util::unindent($output); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 129 | ▶ | sub getopt { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getopt: called CC=3 SCAR=13.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | my ($array, $opts) = map { ref $_[0] eq 'ARRAY' ? shift : $_ } \@ARGV, []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getopt: called CC=3 SCAR=13.5
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my $save = Getopt::Long::Configure(qw(default no_auto_abbrev no_ignore_case), | |||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | @$opts); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | my $success = GetOptionsFromArray $array, @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | Getopt::Long::Configure($save); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | unless ($success) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | Carp::confess("Failed to parse command line options."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 2322 | ▶ | sub convert_class_file_to_dynamic_lib_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_file_to_dynamic_lib_file: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | my ($class_file, $category) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_file_to_dynamic_lib_file: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | my $so = $Config{so}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | $class_file =~ s/\.[^.]+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | my $dynamic_lib_category_file = $class_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 2 | ▶ | $dynamic_lib_category_file .= $category eq 'native' ? ".$so" : ".$category.$so"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 2 | return $dynamic_lib_category_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | sub convert_class_name_to_dynamic_lib_rel_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_dynamic_lib_rel_file: not called CC=2 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | my ($class_name, $category) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_dynamic_lib_rel_file: called CC=2 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my $so = $Config{so}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | my $dynamic_lib_category_rel_file = &convert_class_name_to_rel_file($class_name); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | $dynamic_lib_category_rel_file .= $category eq 'native' ? ".$so" : ".$category.$so"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | return $dynamic_lib_category_rel_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 1846 | ▶ | sub convert_class_name_to_category_rel_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_category_rel_file: called CC=3 SCAR=11.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 24 | ▶ | my ($class_name, $category, $ext) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_category_rel_file: called CC=3 SCAR=11.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | my $rel_file_with_ext = "SPVM::$class_name"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | $rel_file_with_ext =~ s/::/\//g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | $rel_file_with_ext .= $category eq 'native' ? "" : ".$category"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | if (defined $ext) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | $rel_file_with_ext .= ".$ext"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | return $rel_file_with_ext; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | sub convert_class_name_to_rel_dir { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_rel_dir: not called CC=1 SCAR=4.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | ▶ | my ($class_name) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_rel_dir: called CC=1 SCAR=4.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | my $rel_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | my $rel_file = "SPVM::$class_name"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | $rel_file =~ s/::/\//g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | $rel_dir = dirname $rel_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | return $rel_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 5015 | ▶ | sub convert_class_name_to_rel_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_rel_file: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 12 | ▶ | my ($class_name, $ext) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_class_name_to_rel_file: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 12 | my $rel_file_with_ext = "SPVM::$class_name"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 12 | $rel_file_with_ext =~ s/::/\//g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 12 | ▶ | if (defined $ext) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $rel_file_with_ext .= ".$ext"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | return $rel_file_with_ext; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 265 | ▶ | sub get_class_base_dir { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_class_base_dir: called CC=1 SCAR=0.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | my ($file, $class_name) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_class_base_dir: called CC=1 SCAR=0.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | $file =~ s/\.spvm$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | my $class_file = "SPVM::$class_name"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $class_file =~ s/::/\//g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 12 | $file =~ s/$class_file$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 12 | $file =~ s/[\\\/]$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 12 | return $file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | ▶ | sub create_make_rule_native { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_native: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 12 | ▶ | my $class_name = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_native: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 12 | create_make_rule($class_name, 'native', @_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 1 | ▶ | sub create_make_rule_precompile { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_precompile: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 12 | ▶ | my $class_name = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_precompile: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 12 | create_make_rule($class_name, 'precompile', @_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 2 | ▶ | sub create_make_rule { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule: called CC=4 SCAR=15.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 12 | ▶ | my ($class_name, $category, $options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule: called CC=4 SCAR=15.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 12 | ▶ | $options ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$options ||= {}
$options ||= {}
MC/DC0%0/1
$options ||= {}
$options
MC/DC0%0/1
$options ||= {}
$options
Truth table0%0/2
A
A= $options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 12 | ▶ | if ($category eq 'native') { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 12 | $options->{native_classes} = [$class_name]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | elsif ($category eq 'precompile') { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 12 | $options->{precompile_classes} = [$class_name]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | return create_make_rule_parallel($options); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 12 | ▶ | sub create_make_rule_parallel { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_parallel: called CC=20 SCAR=39.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ▶ | my ($options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_parallel: called CC=20 SCAR=39.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | $options ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$options ||= {}
$options ||= {}
MC/DC0%0/1
$options ||= {}
$options
MC/DC0%0/1
$options ||= {}
$options
Truth table0%0/2
A
A= $options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | my $make_rule = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | # Gen target name | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | my @target_parts; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | # Target ID includes filenames for unique SHA1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | if (my $precompile_classes = $options->{precompile_classes}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | push @target_parts, map { "precompile|$_" } @$precompile_classes; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | ▶ | if (my $precompile_classes_file = $options->{precompile_classes_file}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | push @target_parts, "precompile_file|$precompile_classes_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | if (my $native_classes = $options->{native_classes}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | push @target_parts, map { "native|$_" } @$native_classes; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 2 | ▶ | if (my $native_classes_file = $options->{native_classes_file}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | push @target_parts, "native_file|$native_classes_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | # Create SHA1 hex digest | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 2 | my $target_id = sha1_hex(join("\n", sort @target_parts)); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 2 | my $target = "spvm-build-parallel-$target_id"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | # Order-only deps | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 2 | ▶ | my $dependent_files = $options->{dependent_files} // []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$options->{"dependent_files"} // []
$options->{"dependent_files"} // []
MC/DC0%0/1
$options->{"dependent_files"} // []
$options->{"dependent_files"}
MC/DC0%0/1
$options->{"dependent_files"} // []
$options->{"dependent_files"}
Truth table0%0/2
A
A= $options->{"dependent_files"}
Truth table50%1/2
A
A= $options->{"dependent_files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 2 | ▶ | my $dependent_files_string = @$dependent_files ? " " . join(' ', @$dependent_files) : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | my $order_only_dependent_files = $options->{order_only_dependent_files} // []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$options->{"order_only_dependent_files"} // []
$options->{"order_only_dependent_files"} // []
MC/DC0%0/1
$options->{"order_only_dependent_files"} // []
$options->{"order_only_dependent_files"}
MC/DC100%1/1
$options->{"order_only_dependent_files"} // []
$options->{"order_only_dependent_files"}
Truth table0%0/2
A
A= $options->{"order_only_dependent_files"}
Truth table100%2/2
A
A= $options->{"order_only_dependent_files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 8 | ▶ | my $order_only_dependent_files_string = @$order_only_dependent_files ? " | " . join(' ', @$order_only_dependent_files) : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | # Dynamic target | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 8 | $make_rule .= "dynamic :: $target\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 8 | $make_rule .= "\t\$(NOECHO) \$(NOOP)\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | # Parallel build rule | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 8 | $make_rule .= ".PHONY: $target\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 8 | $make_rule .= "$target :$dependent_files_string$order_only_dependent_files_string\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | # Collect all build options | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 8 | my @build_options; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | my $build_dir = $options->{build_dir} // '.spvm_build'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$options->{"build_dir"} // ".spvm_build"
$options->{"build_dir"} // ".spvm_build"
MC/DC0%0/1
$options->{"build_dir"} // ".spvm_build"
$options->{"build_dir"}
MC/DC0%0/1
$options->{"build_dir"} // ".spvm_build"
$options->{"build_dir"}
Truth table0%0/2
A
A= $options->{"build_dir"}
Truth table50%1/2
A
A= $options->{"build_dir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | push @build_options, "build_dir => '$build_dir'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | my $output_dir = $options->{output_dir} // 'blib/lib'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$options->{"output_dir"} // "blib/lib"
$options->{"output_dir"} // "blib/lib"
MC/DC0%0/1
$options->{"output_dir"} // "blib/lib"
$options->{"output_dir"}
MC/DC100%1/1
$options->{"output_dir"} // "blib/lib"
$options->{"output_dir"}
Truth table0%0/2
A
A= $options->{"output_dir"}
Truth table100%2/2
A
A= $options->{"output_dir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | push @build_options, "output_dir => '$output_dir'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | if (defined(my $jobs = $options->{jobs})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | push @build_options, "jobs => $jobs"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 19 | ▶ | if (defined(my $config_global_file = $options->{config_global_file})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 19 | push @build_options, "config_global_file => '$config_global_file'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 19 | ▶ | if (defined(my $native_classes_file = $options->{native_classes_file})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | push @build_options, "native_classes_file => '$native_classes_file'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 17 | ▶ | if (defined(my $precompile_classes_file = $options->{precompile_classes_file})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | push @build_options, "precompile_classes_file => '$precompile_classes_file'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | ▶ | if (my $native_classes = $options->{native_classes}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | push @build_options, "native_classes => [" . join(', ', map { "'$_'" } @$native_classes) . "]"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 0 | ▶ | if (my $precompile_classes = $options->{precompile_classes}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | push @build_options, "precompile_classes => [" . join(', ', map { "'$_'" } @$precompile_classes) . "]"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | 56 | my $build_options_hash_str = "{" . join(', ', @build_options) . "}"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | # Build @INC string for -I | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 56 | ▶ | my $inc = $options->{class_search_dir} // []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$options->{"class_search_dir"} // []
$options->{"class_search_dir"} // []
MC/DC0%0/1
$options->{"class_search_dir"} // []
$options->{"class_search_dir"}
MC/DC100%1/1
$options->{"class_search_dir"} // []
$options->{"class_search_dir"}
Truth table0%0/2
A
A= $options->{"class_search_dir"}
Truth table100%2/2
A
A= $options->{"class_search_dir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 56 | my $inc_string = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 56 | ▶ | if (@$inc) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 56 | $inc_string = join(' ', map { "-I$_" } @$inc) . ' '; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | # Build cmd | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 1 | $make_rule .= "\t\$(FULLPERLRUN) ${inc_string} -Mblib -MSPVM::Builder::API -e \"SPVM::Builder::API::build_parallel_dynamic_lib_dist($build_options_hash_str)\"\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 1 | return $make_rule; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 2025 | ▶ | sub search_config_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_config_file: called CC=4 SCAR=15.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 1 | ▶ | my ($class_name, $mode) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_config_file: called CC=4 SCAR=15.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 1 | my $ext = SPVM::Builder::Config::Util::get_config_ext(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 1 | ▶ | if (defined $mode) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | $ext = "$mode.$ext"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 1 | my $config_file_base = SPVM::Builder::Util::convert_class_name_to_rel_file($class_name, $ext); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | my $config_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | for my $inc (@INC) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | my $config_file_tmp = "$inc/$config_file_base"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 0 | ▶ | if (my $found_config_file = SPVM::Builder::Config::Util::exists_config_file($config_file_tmp)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | $config_file = $found_config_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | return $config_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 2346 | ▶ | sub search_spvm_file { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_spvm_file: called CC=3 SCAR=13.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | ▶ | my ($class_name) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_spvm_file: called CC=3 SCAR=13.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | my $ext = 'spvm'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | my $spvm_file_base = SPVM::Builder::Util::convert_class_name_to_rel_file($class_name, $ext); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | my $spvm_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | for my $inc (@INC) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | my $spvm_file_tmp = "$inc/$spvm_file_base"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | if (-f $spvm_file_tmp) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | $spvm_file = $spvm_file_tmp; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 0 | return $spvm_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 4430 | ▶ | sub get_builder_dir { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_builder_dir: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | ▶ | my $builder_config_dir = $INC{"SPVM/Builder/Config.pm"}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_builder_dir: not called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | my $builder_dir = $builder_config_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | $builder_dir =~ s/\/Config\.pm$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | return $builder_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 2322 | ▶ | sub get_dynamic_lib_file_dist { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_dynamic_lib_file_dist: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 0 | ▶ | my ($class_file, $category) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_dynamic_lib_file_dist: not called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | my $dynamic_lib_file = SPVM::Builder::Util::convert_class_file_to_dynamic_lib_file($class_file, $category); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | 0 | return $dynamic_lib_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 2161 | ▶ | sub create_default_config { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_default_config: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | ▶ | my $config = SPVM::Builder::Config->new_c99; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_default_config: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 0 | return $config; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 9449 | ▶ | sub get_normalized_env { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_normalized_env: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 0 | ▶ | my ($name) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_normalized_env: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 0 | my $value = $ENV{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | 0 | ▶ | if (defined $value && !length $value) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%4/6
defined $value and not length $value
defined $value and not length $value
MC/DC0%0/2
defined $value and not length $value
defined $value
not length $value
MC/DC0%0/2
defined $value and not length $value
defined $value
not length $value
Truth table66%2/3
A and not(B)
A= defined $valueB= not length $value
Truth table66%2/3
A and not(B)
A= defined $valueB= not length $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 0 | $value = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | return $value; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 0 | ▶ | sub get_version_string { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_version_string: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 0 | ▶ | my ($spvm_class_file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_version_string: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | ▶ | open my $spvm_module_fh, '<', $spvm_class_file or die "Can't open the file '$spvm_class_file': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | 0 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | my $content = <$spvm_module_fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | my $version_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | ▶ | if ($content =~ /\bversion\s*"([\d\._]+)"\s*;/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | $version_string = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | unless (defined $version_string) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | confess("The version string can't be find in $spvm_class_file file"); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | return $version_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 1 | ▶ | sub get_spvm_version_string { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_version_string: called CC=4 SCAR=20.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | ▶ | my $builder_dir = &get_builder_dir; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_spvm_version_string: not called CC=4 SCAR=20.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | my $spvm_native_header_file = "$builder_dir/include/spvm_native.h"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | ▶ | open my $spvm_module_fh, '<', $spvm_native_header_file | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | or die "Can't open the file '$spvm_native_header_file': $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 0 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 0 | my $content = <$spvm_module_fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | 0 | my $version_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | ▶ | if ($content =~ /#define\s+SPVM_NATIVE_VERSION_NUMBER\s* ([\d\._]+)/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 0 | $version_string = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 0 | ▶ | unless (defined $version_string) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | 0 | confess("The version string can't be found in '$spvm_native_header_file'"); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 0 | return $version_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 849 | ▶ | sub create_dl_func_list { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_dl_func_list: called CC=5 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | ▶ | my ($class_name, $method_names, $options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_dl_func_list: called CC=5 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 0 | ▶ | $options ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$options ||= {}
$options ||= {}
MC/DC0%0/1
$options ||= {}
$options
MC/DC0%0/1
$options ||= {}
$options
Truth table50%1/2
A
A= $options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 0 | ▶ | my $category = $options->{category} || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$options->{'category'} || ''
$options->{'category'} || ''
MC/DC0%0/1
$options->{'category'} || ''
$options->{'category'}
MC/DC0%0/1
$options->{'category'} || ''
$options->{'category'}
Truth table50%1/2
A
A= $options->{'category'}
Truth table50%1/2
A
A= $options->{'category'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | # dl_func_list | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | # This option is needed Windows DLL file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 0 | my $dl_func_list = []; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 0 | for my $method_name (@$method_names) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | my $cfunc_name = SPVM::Builder::Util::create_cfunc_name($class_name, $method_name, $category); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | push @$dl_func_list, $cfunc_name; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | # This is bad hack to suppress boot strap function error. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | unless (@$dl_func_list) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | push @$dl_func_list, ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 41 | return $dl_func_list; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | 24162 | ▶ | sub create_cfunc_name { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_cfunc_name: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 41 | ▶ | my ($class_name, $method_name, $category) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_cfunc_name: not called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | 41 | my $prefix; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 0 | ▶ | if ($category eq 'native') { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 41 | $prefix = 'SPVM__'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | elsif ($category eq 'precompile') { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 41 | $prefix = 'SPVMPRECOMPILE__' | |||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | # Precompile Method names | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 41 | my $method_abs_name_under_score = "${class_name}::$method_name"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 721 | $method_abs_name_under_score =~ s/:/_/g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 721 | my $cfunc_name = "$prefix$method_abs_name_under_score"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 1 | return $cfunc_name; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 90 | ▶ | sub parse_lib_directive { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_lib_directive: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 1 | ▶ | my ($source, $bin) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_lib_directive: not called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 41 | my $class_search_dirs = []; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 8 | ▶ | while ($source =~ /^#lib "([^"]+)"/gm) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 8 | my $class_search_dir = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | 8 | $class_search_dir =~ s/\$FindBin::Bin/$bin/g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 8 | unshift @$class_search_dirs, $class_search_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 8 | return $class_search_dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | # Create C string literal for MSVC/TCC compatibility | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | my $CREATE_C_STRING_LITERAL_HEX_TABLE = [map { sprintf("0x%02x", $_) } 0..255]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 0 | ▶ | sub create_c_string_literal { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_c_string_literal: not called CC=2 SCAR=10.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 0 | ▶ | my ($content) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_c_string_literal: called CC=2 SCAR=10.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 0 | ▶ | return 'NULL' unless defined $content; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | # write brief comment in English | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | # Use the pre-calculated table to convert bytes to hex values | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | 0 | my $hex_table = $CREATE_C_STRING_LITERAL_HEX_TABLE; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 0 | my @escaped = map { $hex_table->[$_] } unpack('C*', $content); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | # write brief comment in English | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | # Return as a C99 compound literal cast to (const char[]) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | # Includes a null terminator at the end | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 0 | return '(const char[]){' . join(',', @escaped) . ',0}'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | 0 | ▶ | sub build_precompile_header_content_c_source { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_precompile_header_content_c_source: not called CC=3 SCAR=20.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | 0 | ▶ | my ($options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_precompile_header_content_c_source: called CC=3 SCAR=20.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | 0 | my $builder_dir = &get_builder_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | 0 | my $include_dir = "$builder_dir/include"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | 0 | my $src_dir = "$builder_dir/src"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | 0 | my $spvm_native_h = "$include_dir/spvm_native.h"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 0 | my $spvm_implement_h = "$include_dir/spvm_implement.h"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 0 | my $output_file = "$src_dir/spvm_precompile_header_content.c"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | # Minimal definitions for standard types and functions | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | 0 | my $header_content = <<'EOS'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | /* Minimal definitions for standard types and functions */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | #define NULL ((void*)0) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | struct _iobuf; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | typedef struct _iobuf FILE; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | typedef signed char int8_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | typedef short int16_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | typedef int int32_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | typedef unsigned char uint8_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | typedef unsigned short uint16_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | typedef unsigned int uint32_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | #if defined(__LP64__) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | /* LP64 System (Linux, macOS, etc.) */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | typedef long int64_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | typedef unsigned long uint64_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | typedef long intptr_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | typedef unsigned long size_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | #define PRId64 "ld" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | #else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | /* LLP64 System (Windows 64-bit) */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | typedef long long int64_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | typedef unsigned long long uint64_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | typedef long long intptr_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | typedef unsigned long long size_t; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | #define PRId64 "lld" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | #ifndef __builtin_expect | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | # ifdef __has_builtin | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | # if !__has_builtin(__builtin_expect) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | # define __builtin_expect(x, expected_value) (x) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | # endif | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | # else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | # define __builtin_expect(x, expected_value) (x) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | # endif | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | #define PRId8 "d" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | #define PRId16 "d" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | #define PRId32 "d" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | #define INT8_MIN (-128) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | #define INT8_MAX 127 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | #define INT16_MIN (-32768) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | #define INT16_MAX 32767 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | #define INT32_MIN (-2147483647 - 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | #define INT32_MAX 2147483647 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | #define INT64_MIN (-9223372036854775807LL - 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | #define INT64_MAX 9223372036854775807LL | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | #define EOF (-1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | EOS | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | # Remove the #ifndef SPVM_NATIVE_NO_INCLUDE_HEADERS block | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | 0 | ▶ | my $process_header = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | 0 | ▶ | my ($path) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | 0 | my $content = &slurp_binary($path); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | # Remove the block including #ifndef and #endif | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | 0 | $content =~ s/^\s*#ifndef\s+SPVM_NATIVE_NO_INCLUDE_HEADERS.*?#endif//msg; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | # Remove the block including #ifndef and #endif for version utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | 0 | $content =~ s/^\s*#ifndef\s+SPVM_NATIVE_NO_VERSION_UTILITIES.*?#endif//msg; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | 0 | return $content; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | 0 | $header_content .= "\n/* spvm_native.h (headers-stripped) */\n" . $process_header->($spvm_native_h); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | 0 | $header_content .= "\n/* spvm_implement.h (headers-stripped) */\n" . $process_header->($spvm_implement_h); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | 0 | my $c_string_literal = &create_c_string_literal($header_content); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | 0 | my $final_c_source = "/* This file is auto-generated by SPVM::Builder::Util::build_precompile_header_content_c_source */\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | 0 | $final_c_source .= "static const char* spvm_precompile_header_content = \n$c_string_literal;\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | 0 | $final_c_source .= "const char* get_precompile_header_content() {\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | 0 | $final_c_source .= " return spvm_precompile_header_content;\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | 0 | $final_c_source .= "}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | # Check if the content is completely identical | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 0 | ▶ | my $old_content = -f $output_file ? &slurp_binary($output_file) : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | 0 | ▶ | if ($old_content ne $final_c_source) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | 0 | &spurt_binary($output_file, $final_c_source); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | 0 | warn "Generated \"$output_file\".\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | 0 | return $output_file; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | 2058 | ▶ | sub get_cpu_count { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_cpu_count: called CC=6 SCAR=27.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | 0 | ▶ | my $cpu_count; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_cpu_count: called CC=6 SCAR=27.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | 0 | ▶ | if (SPVM::Builder::Util::is_windows()) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | # Windows | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | 0 | ▶ | $cpu_count = $ENV{NUMBER_OF_PROCESSORS} || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
$ENV{'NUMBER_OF_PROCESSORS'} || 1
$ENV{'NUMBER_OF_PROCESSORS'} || 1
MC/DC0%0/1
$ENV{'NUMBER_OF_PROCESSORS'} || 1
$ENV{'NUMBER_OF_PROCESSORS'}
MC/DC0%0/1
$ENV{'NUMBER_OF_PROCESSORS'} || 1
$ENV{'NUMBER_OF_PROCESSORS'}
Truth table0%0/2
A
A= $ENV{'NUMBER_OF_PROCESSORS'}
Truth table0%0/2
A
A= $ENV{'NUMBER_OF_PROCESSORS'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | # Linux / Unix / macOS | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | # (Comment: Using nproc is the most reliable way on modern Linux) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | 0 | my $nproc = `nproc 2>/dev/null`; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | 0 | ▶ | if ($nproc) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | 0 | $cpu_count = int($nproc); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | # (Comment: Fallback to /proc/cpuinfo or sysctl) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | 0 | my $cpuinfo = `grep -c ^processor /proc/cpuinfo 2>/dev/null`; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | 0 | ▶ | if ($cpuinfo) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | 0 | $cpu_count = int($cpuinfo); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | 0 | my $sysctl = `sysctl -n hw.ncpu 2>/dev/null`; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | 0 | ▶ | $cpu_count = $sysctl ? int($sysctl) : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | 28 | return $cpu_count; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | 46611 | ▶ | sub check_option_names { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_option_names: called CC=5 SCAR=17.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | 94 | ▶ | my ($options, $available_option_names) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_option_names: not called CC=5 SCAR=17.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | # Check if options exists | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | 94 | ▶ | unless ($options) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | # Create a hash for fast lookup | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | 0 | my $available_option_names_h = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | 28 | for my $available_option_name (@$available_option_names) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | 95 | $available_option_names_h->{$available_option_name} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | # Validate each option name (Iterate through hash keys) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | 95 | for my $option_name (keys %$options) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | # Check if the option name is available | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | 95 | ▶ | unless ($available_option_names_h->{$option_name}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | 0 | Carp::confess("'$option_name' option is not available."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | 4488 | ▶ | sub normalize_path { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
normalize_path: called CC=3 SCAR=11.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | 93 | ▶ | my ($path, $base_dir) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
normalize_path: called CC=3 SCAR=11.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | 95 | ▶ | unless (defined $path) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | 0 | confess("The path \$path must be defined."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | 95 | ▶ | unless (defined $base_dir) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | 0 | confess("The base directory \$base_dir must be defined."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | 2 | my $abs_path = File::Spec->rel2abs($path); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | 2 | my $abs_base_dir = File::Spec->rel2abs($base_dir); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | 2 | my $normalized_path = File::Spec->abs2rel($abs_path, $abs_base_dir); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | 0 | $normalized_path =~ s|\\|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | 0 | return $normalized_path; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | 3715592 | ▶ | sub quote_literal { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
quote_literal: called CC=6 SCAR=27.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | 0 | ▶ | my ($string) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
quote_literal: called CC=6 SCAR=27.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | 2 | ▶ | if (SPVM::Builder::Util::is_windows()) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | 0 | ▶ | if (length $string && $string !~ /[ \t\n\x0b"|<>%]/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
length $string and not $string =~ /[ \t\n\x0b"|<>%]/
length $string and not $string =~ /[ \t\n\x0b"|<>%]/
MC/DC0%0/2
length $string and not $string =~ /[ \t\n\x0b"|<>%]/
length $string
not $string =~ /[ \t\n\x0b"|<>%]/
MC/DC0%0/2
length $string and not $string =~ /[ \t\n\x0b"|<>%]/
length $string
not $string =~ /[ \t\n\x0b"|<>%]/
Truth table0%0/3
A and not(B)
A= length $stringB= not $string =~ /[ \t\n\x0b"|<>%]/
Truth table0%0/3
A and not(B)
A= length $stringB= not $string =~ /[ \t\n\x0b"|<>%]/
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | 0 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | 0 | $string =~ s{(\\*)(?="|\z)}{$1$1}g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | 0 | $string =~ s{"}{\\"}g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 0 | my $quoted_string = qq{"$string"}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | 0 | return $quoted_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | 0 | ▶ | if (length $string && $string !~ /[^a-zA-Z0-9,._+@%\/-]/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%4/6
length $string and not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
length $string and not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
MC/DC50%1/2
length $string and not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
length $string
not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
MC/DC50%1/2
length $string and not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
length $string
not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
Truth table66%2/3
A and not(B)
A= length $stringB= not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
Truth table66%2/3
A and not(B)
A= length $stringB= not $string =~ m[[^a-zA-Z0-9,._+\@%/-]]
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | 0 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | 0 | $string =~ s{'}{'\\''}g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | 0 | my $quoted_string = "'$string'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | 0 | return $quoted_string; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | 90 | ▶ | sub setup_spvm_command_environment { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setup_spvm_command_environment: called CC=6 SCAR=24.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | 0 | ▶ | my ($script_name, $source, $blib, $class_search_dirs, $build_dir, $quiet, $no_quiet, $warning, $force) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setup_spvm_command_environment: not called CC=6 SCAR=24.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | 0 | $0 = $script_name; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | 0 | FindBin::again(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | 0 | @INC = @{SPVM::Builder::Util::resolve_spvm_command_inc(\@INC, $source, $blib, $class_search_dirs)}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | 0 | ▶ | if (defined $build_dir) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | 0 | $ENV{SPVM_BUILD_DIR} = $build_dir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | 0 | ▶ | if (defined $quiet) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | 0 | $ENV{SPVM_FORCE_QUIET} = $quiet; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | elsif (defined $no_quiet) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | 0 | $ENV{SPVM_FORCE_QUIET} = !$no_quiet; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | 0 | ▶ | if (defined $force) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | 0 | $ENV{SPVM_FORCE_BUILD} = !!$force; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | 0 | ▶ | if ($warning) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 0 | $^W = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | 90 | ▶ | sub resolve_spvm_command_inc { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resolve_spvm_command_inc: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | 0 | ▶ | my ($current_inc, $source, $blib, $class_search_dirs) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resolve_spvm_command_inc: not called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | 0 | my $class_search_dirs_by_lib_directive = SPVM::Builder::Util::parse_lib_directive($source, $FindBin::Bin); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | # Get blib include directories if $blib is true | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | 0 | my @blib_class_search_dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | 0 | ▶ | if ($blib) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | # Temporarily isolate @INC to get paths from the blib module | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 0 | local @INC; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | 0 | require blib; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | 0 | blib->import; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | 0 | @blib_class_search_dirs = @INC; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | # Final include directories | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | 7 | my @inc = @$current_inc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | # To match Perl's @INC priority (last-in, first-priority), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | # we add paths in reverse order of priority using unshift. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | # 3rd priority: include directories from arguments (like -I) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | 7 | unshift @inc, @$class_search_dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | # 2nd priority: include directories from blib (like -Mblib) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | 0 | unshift @inc, @blib_class_search_dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | # 1st priority: include directories from #lib directives in the source (like use lib) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | 7 | unshift @inc, @$class_search_dirs_by_lib_directive; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | 7 | return \@inc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | 3745827 | ▶ | sub is_windows { $^O eq 'MSWin32' } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_windows: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | sub search_gnu_make_command { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | 11 | ▶ | my @commands = ('gmake', 'make'); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
search_gnu_make_command: called CC=5 SCAR=16.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | 11 | for my $command (@commands) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | 11 | my $tempdir_obj = File::Temp->newdir; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | 11 | my $tempdir = $tempdir_obj->dirname; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | 11 | my $filename = "$tempdir/Makefile"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | 18 | ▶ | if (open my $fh, '>', $filename) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | 805 | print $fh "all:\n\t\@: # do nothing\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | 805 | print $fh "\$(info gnu-make-confirmed)\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | 11 | close $fh; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | 805 | my $output = `$command -f $filename 2>&1`; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | 805 | my $exit_code = $?; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | 40460 | ▶ | if ($exit_code == 0 && $output =~ /gnu-make-confirmed/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$exit_code == 0 and $output =~ /gnu-make-confirmed/
MC/DC0%0/2
$exit_code == 0 and $output =~ /gnu-make-confirmed/
$exit_code == 0
$output =~ /gnu-make-confirmed/
Truth table33%1/3
A and B
A= $exit_code == 0B= $output =~ /gnu-make-confirmed/
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | 805 | return $command; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | 2514 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | sub build_parallel_libspvm { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | 0 | ▶ | my ($options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_parallel_libspvm: called CC=4 SCAR=16.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | # For recursive loading | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | 26 | require SPVM::Builder; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | 26 | my @new_option_names = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | 'build_dir', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | 'output_dir', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | 'jobs', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | 0 | my @build_parallel_option_names = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | 'config_global_file', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | 26 | my @all_option_names = (@new_option_names, @build_parallel_option_names); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | 0 | SPVM::Builder::Util::check_option_names($options, \@all_option_names); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | 26 | my %is_new_option = map { $_ => 1 } @new_option_names; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | 26 | my $new_options = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | 26 | my $build_parallel_options = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | 26 | ▶ | if ($options) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | 26884 | for my $key (keys %$options) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | 26884 | ▶ | if ($is_new_option{$key}) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | 0 | $new_options->{$key} = $options->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | 0 | $build_parallel_options->{$key} = $options->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | 0 | my $builder = SPVM::Builder->new(%$new_options); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | 0 | my $link_info = $builder->prepare_compile_spvm_core_source_files($build_parallel_options); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | 0 | $link_info->config->category('libspvm'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | 0 | $link_info->config->class_name('libspvm'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | 26884 | $link_info->dl_func_list(['SPVM_NATIVE_new_env']); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | 24217 | my $diagnostic_message = "[Generate Static Link Library for libpsvm]"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | 2667 | $link_info->diagnostic_message($diagnostic_message); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | 2667 | $link_info->config->output_type('static_lib'); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | 2667 | my $link_infos = [$link_info]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | 2 | $builder->build_parallel_with_link_infos($link_infos, $options); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | sub create_make_rule_parallel_libspvm { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | 2 | ▶ | my ($options) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_make_rule_parallel_libspvm: called CC=10 SCAR=34.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | 2 | ▶ | $options ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$options ||= {}
MC/DC0%0/1
$options ||= {}
$options
Truth table0%0/2
A
A= $options
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | 2 | my $make_rule = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | # Gen target name | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | 2 | my $target = "blib/lib/SPVM/Builder/lib/libspvm.a"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | # Order-only deps | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | 2 | ▶ | my $dependent_files = $options->{dependent_files} // []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$options->{"dependent_files"} // []
MC/DC0%0/1
$options->{"dependent_files"} // []
$options->{"dependent_files"}
Truth table0%0/2
A
A= $options->{"dependent_files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | 1 | ▶ | my $dependent_files_string = @$dependent_files ? " " . join(' ', @$dependent_files) : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | 2 | ▶ | my $order_only_dependent_files = $options->{order_only_dependent_files} // []; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$options->{"order_only_dependent_files"} // []
MC/DC0%0/1
$options->{"order_only_dependent_files"} // []
$options->{"order_only_dependent_files"}
Truth table0%0/2
A
A= $options->{"order_only_dependent_files"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | 2 | ▶ | my $order_only_dependent_files_string = @$order_only_dependent_files ? " | " . join(' ', @$order_only_dependent_files) : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | # Dynamic target | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | 0 | $make_rule .= "dynamic :: $target\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | 2 | $make_rule .= "\t\$(NOECHO) \$(NOOP)\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | # Parallel build rule | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | 0 | $make_rule .= ".PHONY: $target\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | 2 | $make_rule .= "$target :$dependent_files_string$order_only_dependent_files_string\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | # Collect all build options | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | 0 | my @build_options; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | 2 | ▶ | my $build_dir = $options->{build_dir} // '.spvm_build'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$options->{"build_dir"} // ".spvm_build"
MC/DC0%0/1
$options->{"build_dir"} // ".spvm_build"
$options->{"build_dir"}
Truth table0%0/2
A
A= $options->{"build_dir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | 2 | push @build_options, "build_dir => '$build_dir'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | 2 | ▶ | my $output_dir = $options->{output_dir} // 'blib/lib'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$options->{"output_dir"} // "blib/lib"
MC/DC0%0/1
$options->{"output_dir"} // "blib/lib"
$options->{"output_dir"}
Truth table0%0/2
A
A= $options->{"output_dir"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | 2 | push @build_options, "output_dir => '$output_dir'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | 0 | ▶ | if (defined(my $jobs = $options->{jobs})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | 0 | push @build_options, "jobs => $jobs"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | 0 | ▶ | if (defined(my $config_global_file = $options->{config_global_file})) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | 0 | push @build_options, "config_global_file => '$config_global_file'"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | 2 | my $build_options_hash_str = "{" . join(', ', @build_options) . "}"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | # Build cmd | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | 2 | $make_rule .= "\t\$(FULLPERLRUN) -Mblib -MSPVM::Builder::Util -e \"SPVM::Builder::Util::build_parallel_libspvm($build_options_hash_str)\"\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | 2 | return $make_rule; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | sub is_msvc { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | 116 | ▶ | my ($cc) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_msvc: called CC=3 SCAR=11.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | 116 | ▶ | unless (defined $cc) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | 27312 | confess("Compiler \$cc must be defined."); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | 114 | my $is_msvc = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | 114 | ▶ | if ($cc =~ /cl(\.exe)?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | 0 | $is_msvc = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | 114 | return $is_msvc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | sub is_gcc_compatible { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | 0 | ▶ | my ($cc) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_gcc_compatible: called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | 0 | my $is_gcc_compatible = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | 0 | ▶ | if ($cc =~ /(?:gcc|clang|g\+\+|clang\+\+)(?:\.exe)?$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | 0 | $is_gcc_compatible = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | 0 | return $is_gcc_compatible; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | =head1 Name | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | SPVM::Builder::Util - Builder Utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | =head1 Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | The SPVM::Builder::Util class has utility functions for L<SPVM::Builder> class. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | =head1 Copyright & License | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | Copyright (c) 2023 Yuki Kimoto | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | MIT License | ||||||||||||||||||||||||||||||||||||||||||||||||||