Skip to content

Commit

Permalink
Rearrange cover_basic_blocks header
Browse files Browse the repository at this point in the history
Put type definition at the beggining.
Remove typedef that are used only once (they hide what the type actually
is).
Use private membres instead of protected.
  • Loading branch information
romainbrenguier committed Feb 9, 2018
1 parent 14f2bf2 commit 3ef6759
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/goto-instrument/cover_basic_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ class cover_basic_blockst
public:
struct block_infot
{
/// the program location to instrument for this block
/// the program instruction representative for this block
optionalt<goto_programt::const_targett> representative_inst;

/// the source location representative for this block
// (we need a separate copy of source locations because we attach
// the line number ranges to them)
source_locationt source_location;

// map block numbers to source code locations
/// the set of lines belonging to this block
std::unordered_set<unsigned> lines;
};
Expand Down Expand Up @@ -72,14 +71,10 @@ class cover_basic_blockst
/// Outputs the list of blocks
void output(std::ostream &out) const;

protected:
private:
// map program locations to block numbers
typedef std::map<goto_programt::const_targett, unsigned> block_mapt;
block_mapt block_map;

typedef std::vector<block_infot> block_infost;
block_infost block_infos;

std::map<goto_programt::const_targett, unsigned> block_map;
std::vector<block_infot> block_infos;
};

#endif // CPROVER_GOTO_INSTRUMENT_COVER_BASIC_BLOCKS_H

0 comments on commit 3ef6759

Please sign in to comment.