CBMC
|
Decorator for a message_handlert used during function inlining that collect names of GOTO functions creating warnings and allows to turn inlining warnings into hard errors. More...
#include <inlining_decorator.h>
Public Member Functions | |
inlining_decoratort (message_handlert &_wrapped) | |
void | throw_on_no_body (messaget &log, const int error_code) |
Throws the given error code if no body for function warnings happend during inlining. More... | |
void | throw_on_recursive_calls (messaget &log, const int error_code) |
Throws the given error code if recursive call warnings happend during inlining. More... | |
void | throw_on_missing_function (messaget &log, const int error_code) |
Throws the given error code if missing function warnings happend during inlining. More... | |
void | throw_on_not_enough_arguments (messaget &log, const int error_code) |
Throws the given error code if not enough arguments warnings happend during inlining. More... | |
const std::set< irep_idt > & | get_no_body_set () const |
const std::set< irep_idt > & | get_missing_function_set () const |
const std::set< irep_idt > & | get_recursive_call_set () const |
const std::set< irep_idt > & | get_not_enough_arguments_set () const |
void | print (unsigned level, const std::string &message) override |
void | print (unsigned level, const xmlt &xml) override |
void | print (unsigned level, const jsont &json) override |
void | print (unsigned level, const structured_datat &data) override |
void | print (unsigned level, const std::string &message, const source_locationt &location) override |
void | flush (unsigned i) override |
void | set_verbosity (unsigned _verbosity) |
unsigned | get_verbosity () const |
std::size_t | get_message_count (unsigned level) const |
std::string | command (unsigned i) const override |
Create an ECMA-48 SGR (Select Graphic Rendition) command. More... | |
Private Member Functions | |
void | match_no_body_warning (const std::string &message) |
void | match_missing_function_warning (const std::string &message) |
void | match_recursive_call_warning (const std::string &message) |
void | match_not_enough_arguments_warning (const std::string &message) |
void | parse_message (const std::string &message) |
Private Attributes | |
message_handlert & | wrapped |
std::regex | no_body_regex |
std::set< irep_idt > | no_body_set |
std::regex | missing_function_regex |
std::set< irep_idt > | missing_function_set |
std::regex | recursive_call_regex |
std::set< irep_idt > | recursive_call_set |
std::regex | not_enough_arguments_regex |
std::set< irep_idt > | not_enough_arguments_set |
Additional Inherited Members |
Decorator for a message_handlert used during function inlining that collect names of GOTO functions creating warnings and allows to turn inlining warnings into hard errors.
The decorator intercepts and parses messages sent to the decorated message handler and collects the names of GOTO functions involved in these 4 types warnings:
recursive call
warnings,missing function
warnings,not enough arguments
warnings,no body for function
warnings.For each warning type, the decorator offers:
So this decorator allows to inspect the sets of functions involved in warnings to check if the warnings are expected or not, and to turn warnings into hard errors if desired.
Decorator pattern info: https://en.wikipedia.org/wiki/Decorator_pattern
Definition at line 41 of file inlining_decorator.h.
|
explicit |
Definition at line 13 of file inlining_decorator.cpp.
|
inlineoverridevirtual |
Create an ECMA-48 SGR (Select Graphic Rendition) command.
The default behavior is no action.
Reimplemented from message_handlert.
Definition at line 158 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 138 of file inlining_decorator.h.
|
inline |
Definition at line 153 of file inlining_decorator.h.
|
inline |
Definition at line 92 of file inlining_decorator.h.
|
inline |
Definition at line 87 of file inlining_decorator.h.
|
inline |
Definition at line 102 of file inlining_decorator.h.
|
inline |
Definition at line 97 of file inlining_decorator.h.
|
inline |
Definition at line 148 of file inlining_decorator.h.
|
private |
Definition at line 33 of file inlining_decorator.cpp.
|
private |
Definition at line 25 of file inlining_decorator.cpp.
|
private |
Definition at line 51 of file inlining_decorator.cpp.
|
private |
Definition at line 42 of file inlining_decorator.cpp.
|
private |
Definition at line 60 of file inlining_decorator.cpp.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 118 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 107 of file inlining_decorator.h.
|
inlineoverridevirtual |
Reimplemented from message_handlert.
Definition at line 128 of file inlining_decorator.h.
|
inlineoverridevirtual |
Reimplemented from message_handlert.
Definition at line 123 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 113 of file inlining_decorator.h.
|
inline |
Definition at line 143 of file inlining_decorator.h.
void inlining_decoratort::throw_on_missing_function | ( | messaget & | log, |
const int | error_code | ||
) |
Throws the given error code if missing function
warnings happend during inlining.
Definition at line 96 of file inlining_decorator.cpp.
void inlining_decoratort::throw_on_no_body | ( | messaget & | log, |
const int | error_code | ||
) |
Throws the given error code if no body for function
warnings happend during inlining.
Definition at line 68 of file inlining_decorator.cpp.
void inlining_decoratort::throw_on_not_enough_arguments | ( | messaget & | log, |
const int | error_code | ||
) |
Throws the given error code if not enough arguments
warnings happend during inlining.
Definition at line 111 of file inlining_decorator.cpp.
void inlining_decoratort::throw_on_recursive_calls | ( | messaget & | log, |
const int | error_code | ||
) |
Throws the given error code if recursive call
warnings happend during inlining.
Definition at line 81 of file inlining_decorator.cpp.
|
private |
Definition at line 51 of file inlining_decorator.h.
|
private |
Definition at line 52 of file inlining_decorator.h.
|
private |
Definition at line 46 of file inlining_decorator.h.
|
private |
Definition at line 47 of file inlining_decorator.h.
|
private |
Definition at line 61 of file inlining_decorator.h.
|
private |
Definition at line 62 of file inlining_decorator.h.
|
private |
Definition at line 56 of file inlining_decorator.h.
|
private |
Definition at line 57 of file inlining_decorator.h.
|
private |
Definition at line 44 of file inlining_decorator.h.