Go to the documentation of this file.
20 if(instruction->incoming_edges.size() != 1)
25 in_t->is_goto() && !in_t->is_backwards_goto() &&
26 in_t->condition().is_true())
34 bool next_is_target =
true;
35 std::size_t current_block = 0;
40 if(next_is_target || it->is_target())
44 current_block = *block_number;
56 current_block <
block_infos.size(),
"current block number out of range");
65 !it->source_location().is_nil() &&
66 !it->source_location().get_file().empty() &&
67 !it->source_location().get_line().empty() &&
68 !it->source_location().is_built_in() &&
78 it->is_goto() || it->is_function_call() || it->is_assume();
80 it->is_goto() || it->is_function_call();
119 std::set<std::size_t> blocks_seen;
122 const std::size_t block_nr =
block_of(it);
126 blocks_seen.insert(block_nr).second &&
129 msg.
warning() <<
"Ignoring block " << (block_nr + 1) <<
" location "
131 <<
" (bytecode-index already instrumented)"
138 msg.
warning() <<
"Ignoring block " << (block_nr + 1) <<
" location "
139 << it->location_number <<
" " << function_id
150 out << block_pair.first->source_location() <<
" -> " << block_pair.second
159 const irep_idt &line = location.get_line();
168 if(!location.get_function().empty())
169 add_location(location);
178 const auto &location = it->source_location();
179 const auto &bytecode_index = location.get_java_bytecode_index();
197 const auto &bytecode_index = t->source_location().get_java_bytecode_index();
Class that provides messages with a built-in verbosity 'level'.
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
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)
static const source_locationt & nil()
source_locationt source_location
the source location representative for this block (we need a separate copy of source locations becaus...
std::vector< source_linest > block_source_lines
Base class for all expressions.
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
void insert(const source_locationt &loc)
Insert a line (a source location) into the set of lines.
block_mapt block_map
map program locations to block numbers
const goto_instruction_codet & get_code() const
Get the code represented by this instruction.
const source_linest & source_lines_of(std::size_t block_nr) const override
const source_locationt & source_location() const
source_locationt source_location
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
#define PRECONDITION(CONDITION)
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
nonstd::optional< T > optionalt
instructionst instructions
The list of instructions in the goto program.
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.
void visit_pre(std::function< void(exprt &)>)
A generic container class for the GOTO intermediate representation of one function.
instructionst::const_iterator const_targett
mstreamt & warning() const
This class represents an instruction in the GOTO intermediate representation.
const source_locationt & source_location() const
optionalt< goto_programt::const_targett > representative_inst
the program location to instrument for this block
instructionst::iterator targett
#define forall_goto_program_instructions(it, program)
cover_basic_blockst(const goto_programt &goto_program)