Go to the documentation of this file.
12 #ifndef CPROVER_GOTO_INSTRUMENT_COVER_BASIC_BLOCKS_H
13 #define CPROVER_GOTO_INSTRUMENT_COVER_BASIC_BLOCKS_H
15 #include <unordered_set>
51 virtual void output(std::ostream &out)
const = 0;
65 (void)message_handler;
105 void output(std::ostream &out)
const override;
108 typedef std::map<goto_programt::const_targett, std::size_t>
block_mapt;
175 void output(std::ostream &out)
const override;
178 #endif // CPROVER_GOTO_INSTRUMENT_COVER_BASIC_BLOCKS_H
optionalt< goto_programt::const_targett > instruction_of(std::size_t block_nr) const override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::unordered_map< irep_idt, std::size_t > index_to_block
virtual const source_locationt & source_location_of(std::size_t block_nr) const =0
static void add_block_lines(cover_basic_blockst::block_infot &block, const goto_programt::instructiont &instruction)
Adds the lines which instruction spans to block.
cover_basic_blocks_javat(const goto_programt &_goto_program)
source_locationt source_location
the source location representative for this block (we need a separate copy of source locations becaus...
virtual void output(std::ostream &out) const =0
Outputs the list of blocks.
std::vector< source_linest > block_source_lines
void report_block_anomalies(const irep_idt &function_id, const goto_programt &goto_program, message_handlert &message_handler) override
Output warnings about ignored blocks.
source_linest source_lines
the set of source code lines belonging to this block
std::size_t block_of(goto_programt::const_targett t) const override
block_mapt block_map
map program locations to block numbers
virtual const source_linest & source_lines_of(std::size_t block_nr) const =0
const source_linest & source_lines_of(std::size_t block_nr) const override
static optionalt< std::size_t > continuation_of_block(const goto_programt::const_targett &instruction, block_mapt &block_map)
If this block is a continuation of a previous block through unconditional forward gotos,...
std::vector< block_infot > block_infos
map block numbers to block information
virtual optionalt< goto_programt::const_targett > instruction_of(std::size_t block_nr) const =0
const source_locationt & source_location_of(std::size_t block_nr) const override
std::size_t block_of(goto_programt::const_targett t) const override
std::vector< source_locationt > block_locations
const source_linest & source_lines_of(std::size_t block_number) const override
std::vector< goto_programt::const_targett > block_infos
virtual void report_block_anomalies(const irep_idt &function_id, const goto_programt &goto_program, message_handlert &message_handler)
Output warnings about ignored blocks.
nonstd::optional< T > optionalt
const source_locationt & source_location_of(std::size_t block_number) const override
optionalt< goto_programt::const_targett > instruction_of(std::size_t block_number) const override
std::map< goto_programt::const_targett, std::size_t > block_mapt
void output(std::ostream &out) const override
Outputs the list of blocks.
void output(std::ostream &out) const override
Outputs the list of blocks.
A generic container class for the GOTO intermediate representation of one function.
virtual ~cover_blocks_baset()=default
instructionst::const_iterator const_targett
This class represents an instruction in the GOTO intermediate representation.
virtual std::size_t block_of(goto_programt::const_targett t) const =0
optionalt< goto_programt::const_targett > representative_inst
the program location to instrument for this block
cover_basic_blockst(const goto_programt &goto_program)