line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SPVM::Builder::ObjectFileInfo; |
2
|
|
|
|
|
|
|
|
3
|
280
|
|
|
485
|
|
70037
|
use strict; |
|
280
|
|
|
|
|
583
|
|
|
280
|
|
|
|
|
8128
|
|
4
|
280
|
|
|
280
|
|
1363
|
use warnings; |
|
280
|
|
|
|
|
535
|
|
|
280
|
|
|
|
|
6701
|
|
5
|
280
|
|
|
280
|
|
1313
|
use Config; |
|
280
|
|
|
|
|
516
|
|
|
280
|
|
|
|
|
8780
|
|
6
|
280
|
|
|
280
|
|
1471
|
use Carp 'confess'; |
|
280
|
|
|
|
|
543
|
|
|
280
|
|
|
|
|
12801
|
|
7
|
280
|
|
|
280
|
|
1766
|
use File::Basename 'dirname'; |
|
280
|
|
|
|
|
664
|
|
|
280
|
|
|
|
|
24515
|
|
8
|
|
|
|
|
|
|
|
9
|
280
|
|
|
280
|
|
3118
|
use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1; |
|
280
|
|
|
226
|
|
1554
|
|
|
280
|
|
|
|
|
2736
|
|
|
0
|
|
|
|
|
0
|
|
|
480
|
|
|
|
|
2932
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Fields |
12
|
|
|
|
|
|
|
sub file { |
13
|
989
|
|
|
989
|
1
|
2359
|
my $self = shift; |
14
|
989
|
50
|
|
|
|
3297
|
if (@_) { |
15
|
0
|
|
|
|
|
0
|
$self->{file} = $_[0]; |
16
|
0
|
|
|
|
|
0
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
989
|
|
|
|
|
7509
|
return $self->{file}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub compile_info { |
24
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
25
|
0
|
0
|
|
|
|
0
|
if (@_) { |
26
|
0
|
|
|
|
|
0
|
$self->{compile_info} = $_[0]; |
27
|
0
|
|
|
|
|
0
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
0
|
|
|
|
|
0
|
return $self->{compile_info}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Class methods |
35
|
|
|
|
|
|
|
sub new { |
36
|
481
|
|
|
481
|
1
|
3162
|
my $class = shift; |
37
|
|
|
|
|
|
|
|
38
|
481
|
|
|
|
|
5350
|
my $self = {@_}; |
39
|
|
|
|
|
|
|
|
40
|
481
|
|
|
|
|
3685
|
bless $self, $class; |
41
|
|
|
|
|
|
|
|
42
|
481
|
|
|
|
|
2885
|
return $self; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Instance methods |
46
|
|
|
|
|
|
|
sub to_string { |
47
|
989
|
|
|
989
|
1
|
2739
|
my ($self) = @_; |
48
|
|
|
|
|
|
|
|
49
|
989
|
|
|
|
|
3857
|
return $self->file; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 Name |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
SPVM::Builder::ObjectFileInfo - Object File Information |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 Description |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
The SPVM::Builder::ObjectFileInfo class has methods to manipulate information of an object file. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 Fields |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 file |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $file = $object_file_info->file; |
67
|
|
|
|
|
|
|
$object_file_info->file($file); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Gets and sets the C field. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This field is the file name of an object file. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 compile_info |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
my $compile_info = $object_file_info->compile_info; |
76
|
|
|
|
|
|
|
$object_file_info->compile_info($compile_info); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Gets and sets the C field. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This field is a L object. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 Class Methods |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 new |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
my $object_file_info = SPVM::Builder::ObjectFileInfo->new(%fields); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Default Field Values: |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
If a field is not defined, the field is set to the following default value. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=over 2 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * L"file"> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
undef |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * L"compile_info"> |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
undef |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=back |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 Instance Methods |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 to_string |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my $object_file_info = $object_file_info->to_string; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Returns the L"file"> field. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 Operators |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Overloads the following operators. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 bool |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
my $bool = !!$object_file_info; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Always true. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head2 stringify |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
my $object_file_info_name = "$object_file_info"; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Alias for the L"to_string"> method. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 Copyright & License |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Copyright (c) 2023 Yuki Kimoto |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
MIT License |