@@ -18,44 +18,88 @@ Author: Daniel Kroening
18
18
19
19
class message_handlert ;
20
20
21
- class cover_basic_blockst final
21
+ class cover_blocks_baset
22
+ {
23
+ public:
24
+ // / \param t a goto instruction
25
+ // / \return the block number of the block
26
+ // / the given goto instruction is part of
27
+ virtual std::size_t block_of (goto_programt::const_targett t) const = 0;
28
+
29
+ // / \param block_nr a block number
30
+ // / \return the instruction selected for
31
+ // / instrumentation representative of the given block
32
+ virtual optionalt<goto_programt::const_targett>
33
+ instruction_of (std::size_t block_nr) const = 0 ;
34
+
35
+ // / \param block_nr a block number
36
+ // / \return the source location selected for
37
+ // / instrumentation representative of the given block
38
+ virtual const source_locationt &
39
+ source_location_of (std::size_t block_nr) const = 0 ;
40
+
41
+ // / Select an instruction to be instrumented for each basic block such that
42
+ // / the java bytecode indices for each basic block is unique
43
+ // / \param goto_program The goto program
44
+ // / \param message_handler The message handler
45
+ virtual void select_unique_java_bytecode_indices (
46
+ const goto_programt &goto_program,
47
+ message_handlert &message_handler)
48
+ {
49
+ }
50
+
51
+ // / Outputs the list of blocks
52
+ virtual void output (std::ostream &out) const = 0;
53
+
54
+ // / Output warnings about ignored blocks
55
+ // / \param goto_program The goto program
56
+ // / \param message_handler The message handler
57
+ virtual void report_block_anomalies (
58
+ const goto_programt &goto_program,
59
+ message_handlert &message_handler)
60
+ {
61
+ }
62
+ };
63
+
64
+ class cover_basic_blockst final : public cover_blocks_baset
22
65
{
23
66
public:
24
67
explicit cover_basic_blockst (const goto_programt &_goto_program);
25
68
26
69
// / \param t a goto instruction
27
70
// / \return the block number of the block
28
71
// / the given goto instruction is part of
29
- std::size_t block_of (goto_programt::const_targett t) const ;
72
+ std::size_t block_of (goto_programt::const_targett t) const override ;
30
73
31
74
// / \param block_nr a block number
32
75
// / \return the instruction selected for
33
76
// / instrumentation representative of the given block
34
77
optionalt<goto_programt::const_targett>
35
- instruction_of (std::size_t block_nr) const ;
78
+ instruction_of (std::size_t block_nr) const override ;
36
79
37
80
// / \param block_nr a block number
38
81
// / \return the source location selected for
39
82
// / instrumentation representative of the given block
40
- const source_locationt &source_location_of (std::size_t block_nr) const ;
83
+ const source_locationt &
84
+ source_location_of (std::size_t block_nr) const override ;
41
85
42
86
// / Select an instruction to be instrumented for each basic block such that
43
87
// / the java bytecode indices for each basic block is unique
44
88
// / \param goto_program The goto program
45
89
// / \param message_handler The message handler
46
90
void select_unique_java_bytecode_indices (
47
91
const goto_programt &goto_program,
48
- message_handlert &message_handler);
92
+ message_handlert &message_handler) override ;
49
93
50
94
// / Output warnings about ignored blocks
51
95
// / \param goto_program The goto program
52
96
// / \param message_handler The message handler
53
97
void report_block_anomalies (
54
98
const goto_programt &goto_program,
55
- message_handlert &message_handler);
99
+ message_handlert &message_handler) override ;
56
100
57
101
// / Outputs the list of blocks
58
- void output (std::ostream &out) const ;
102
+ void output (std::ostream &out) const override ;
59
103
60
104
private:
61
105
typedef std::map<goto_programt::const_targett, std::size_t > block_mapt;
0 commit comments