cprover
cover.cpp File Reference

Coverage Instrumentation. More...

#include "cover.h"
#include <util/config.h>
#include <util/message.h>
#include <util/make_unique.h>
#include <util/cmdline.h>
#include <util/options.h>
#include <util/deprecate.h>
#include <goto-programs/remove_skip.h>
#include "cover_basic_blocks.h"
+ Include dependency graph for cover.cpp:

Go to the source code of this file.

Functions

void instrument_cover_goals (goto_programt &goto_program, const cover_instrumenterst &instrumenters, const irep_idt &mode, message_handlert &message_handler)
 Applies instrumenters to given goto program. More...
 
void instrument_cover_goals (const symbol_tablet &symbol_table, goto_programt &goto_program, coverage_criteriont criterion, message_handlert &message_handler)
 Instruments goto program for a given coverage criterion. More...
 
coverage_criteriont parse_coverage_criterion (const std::string &criterion_string)
 Parses a coverage criterion. More...
 
void parse_cover_options (const cmdlinet &cmdline, optionst &options)
 Parses coverage-related command line options. More...
 
std::unique_ptr< cover_configtget_cover_config (const optionst &options, const symbol_tablet &symbol_table, message_handlert &message_handler)
 Build data structures controlling coverage from command-line options. More...
 
static void instrument_cover_goals (const cover_configt &config, const irep_idt &function_id, goto_functionst::goto_functiont &function, message_handlert &message_handler)
 Instruments a single goto program based on the given configuration. More...
 
void instrument_cover_goals (const cover_configt &config, goto_model_functiont &function, message_handlert &message_handler)
 Instruments a single goto program based on the given configuration. More...
 
bool instrument_cover_goals (const optionst &options, const symbol_tablet &symbol_table, goto_functionst &goto_functions, message_handlert &message_handler)
 Instruments goto functions based on given command line options. More...
 
bool instrument_cover_goals (const optionst &options, goto_modelt &goto_model, message_handlert &message_handler)
 Instruments a goto model based on given command line options. More...
 

Detailed Description

Coverage Instrumentation.

Definition in file cover.cpp.

Function Documentation

◆ get_cover_config()

std::unique_ptr<cover_configt> get_cover_config ( const optionst options,
const symbol_tablet symbol_table,
message_handlert message_handler 
)

Build data structures controlling coverage from command-line options.

Parameters
optionscommand-line options
symbol_tableglobal symbol table
message_handlerused to log incorrect option specifications
Returns
a cover_configt on success, or null otherwise.

Definition at line 184 of file cover.cpp.

◆ instrument_cover_goals() [1/6]

void instrument_cover_goals ( goto_programt goto_program,
const cover_instrumenterst instrumenters,
const irep_idt mode,
message_handlert message_handler 
)

Applies instrumenters to given goto program.

Parameters
goto_programthe goto program
instrumentersthe instrumenters
modemode of the function to instrument (for instance ID_C or ID_java)
message_handlera message handler

Definition at line 33 of file cover.cpp.

◆ instrument_cover_goals() [2/6]

void instrument_cover_goals ( const symbol_tablet symbol_table,
goto_programt goto_program,
coverage_criteriont  criterion,
message_handlert message_handler 
)

Instruments goto program for a given coverage criterion.

Parameters
symbol_tablethe symbol table
goto_programthe goto program
criterionthe coverage criterion
message_handlera message handler
Deprecated:
use instrument_cover_goals(goto_programt &goto_program, const cover_instrumenterst &instrumenters, message_handlert &message_handler, const irep_idt mode) instead

Definition at line 58 of file cover.cpp.

◆ instrument_cover_goals() [3/6]

static void instrument_cover_goals ( const cover_configt config,
const irep_idt function_id,
goto_functionst::goto_functiont function,
message_handlert message_handler 
)
static

Instruments a single goto program based on the given configuration.

Parameters
configconfiguration, produced using get_cover_config
function_idfunction name
functionfunction function to instrument
message_handlerlog output

Definition at line 253 of file cover.cpp.

◆ instrument_cover_goals() [4/6]

void instrument_cover_goals ( const cover_configt config,
goto_model_functiont function,
message_handlert message_handler 
)

Instruments a single goto program based on the given configuration.

Parameters
configconfiguration, produced using get_cover_config
functiongoto program to instrument
message_handlerlog output

Definition at line 302 of file cover.cpp.

◆ instrument_cover_goals() [5/6]

bool instrument_cover_goals ( const optionst options,
const symbol_tablet symbol_table,
goto_functionst goto_functions,
message_handlert message_handler 
)

Instruments goto functions based on given command line options.

Parameters
optionsthe options
symbol_tablethe symbol table
goto_functionsthe goto functions
message_handlera message handler

Definition at line 321 of file cover.cpp.

◆ instrument_cover_goals() [6/6]

bool instrument_cover_goals ( const optionst options,
goto_modelt goto_model,
message_handlert message_handler 
)

Instruments a goto model based on given command line options.

Parameters
optionsthe options
goto_modelthe goto model
message_handlera message handler

Definition at line 362 of file cover.cpp.

◆ parse_cover_options()

void parse_cover_options ( const cmdlinet cmdline,
optionst options 
)

Parses coverage-related command line options.

Parameters
cmdlinethe command line
optionsthe options

Definition at line 160 of file cover.cpp.

◆ parse_coverage_criterion()

coverage_criteriont parse_coverage_criterion ( const std::string &  criterion_string)

Parses a coverage criterion.

Parameters
criterion_stringa string
Returns
a coverage criterion or throws an exception

Definition at line 127 of file cover.cpp.