File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,7 @@ cover_basic_blockst::cover_basic_blockst(const goto_programt &goto_program)
58
58
59
59
block_map[it] = current_block;
60
60
61
- // update lines belonging to block
62
- const irep_idt &line = it->source_location .get_line ();
63
- if (!line.empty ())
64
- {
65
- block_info.lines .insert (unsafe_string2unsigned (id2string (line)));
66
- block_info.source_lines .insert (it->source_location );
67
- }
61
+ add_block_lines (block_info, *it);
68
62
69
63
// set representative program location to instrument
70
64
if (
@@ -155,6 +149,18 @@ void cover_basic_blockst::output(std::ostream &out) const
155
149
<< ' \n ' ;
156
150
}
157
151
152
+ void cover_basic_blockst::add_block_lines (
153
+ cover_basic_blockst::block_infot &block,
154
+ const goto_programt::instructiont &instruction)
155
+ {
156
+ const irep_idt &line = instruction.source_location .get_line ();
157
+ if (!line.empty ())
158
+ {
159
+ block.lines .insert (unsafe_string2unsigned (id2string (line)));
160
+ block.source_lines .insert (instruction.source_location );
161
+ }
162
+ }
163
+
158
164
void cover_basic_blockst::update_covered_lines (block_infot &block_info)
159
165
{
160
166
if (block_info.source_location .is_nil ())
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ class cover_basic_blockst final : public cover_blocks_baset
119
119
// / map block numbers to block information
120
120
std::vector<block_infot> block_infos;
121
121
122
+ // / Adds the lines which \param instruction spans to \param block.
123
+ static void add_block_lines (
124
+ cover_basic_blockst::block_infot &block,
125
+ const goto_programt::instructiont &instruction);
126
+
122
127
// / create list of covered lines as CSV string and set as property of source
123
128
// / location of basic block, compress to ranges if applicable
124
129
static void update_covered_lines (block_infot &block_info);
You can’t perform that action at this time.
0 commit comments