Skip to content

Commit 6492b3a

Browse files
Rearrange cover_basic_blocks header
Use private instead of protected. Remove typedef used only once. Document members. Mark class final.
1 parent a9549e7 commit 6492b3a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/goto-instrument/cover_basic_blocks.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Author: Daniel Kroening
1818

1919
class message_handlert;
2020

21-
class cover_basic_blockst
21+
class cover_basic_blockst final
2222
{
2323
public:
2424
explicit cover_basic_blockst(const goto_programt &_goto_program);
@@ -57,28 +57,27 @@ class cover_basic_blockst
5757
/// Outputs the list of blocks
5858
void output(std::ostream &out) const;
5959

60-
protected:
61-
// map program locations to block numbers
60+
private:
6261
typedef std::map<goto_programt::const_targett, unsigned> block_mapt;
63-
block_mapt block_map;
6462

6563
struct block_infot
6664
{
6765
/// the program location to instrument for this block
6866
optionalt<goto_programt::const_targett> representative_inst;
6967

7068
/// the source location representative for this block
71-
// (we need a separate copy of source locations because we attach
72-
// the line number ranges to them)
69+
/// (we need a separate copy of source locations because we attach
70+
/// the line number ranges to them)
7371
source_locationt source_location;
7472

75-
// map block numbers to source code locations
7673
/// the set of lines belonging to this block
7774
std::unordered_set<unsigned> lines;
7875
};
7976

80-
typedef std::vector<block_infot> block_infost;
81-
block_infost block_infos;
77+
/// map program locations to block numbers
78+
block_mapt block_map;
79+
/// map block numbers to block information
80+
std::vector<block_infot> block_infos;
8281

8382
/// create list of covered lines as CSV string and set as property of source
8483
/// location of basic block, compress to ranges if applicable

0 commit comments

Comments
 (0)