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 42 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 159 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 139 of file inlining_decorator.h.
|
inline |
Definition at line 154 of file inlining_decorator.h.
|
inline |
Definition at line 93 of file inlining_decorator.h.
|
inline |
Definition at line 88 of file inlining_decorator.h.
|
inline |
Definition at line 103 of file inlining_decorator.h.
|
inline |
Definition at line 98 of file inlining_decorator.h.
|
inline |
Definition at line 149 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 119 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 108 of file inlining_decorator.h.
|
inlineoverridevirtual |
Reimplemented from message_handlert.
Definition at line 129 of file inlining_decorator.h.
|
inlineoverridevirtual |
Reimplemented from message_handlert.
Definition at line 124 of file inlining_decorator.h.
|
inlineoverridevirtual |
Implements message_handlert.
Definition at line 114 of file inlining_decorator.h.
|
inline |
Definition at line 144 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 52 of file inlining_decorator.h.
|
private |
Definition at line 53 of file inlining_decorator.h.
|
private |
Definition at line 47 of file inlining_decorator.h.
|
private |
Definition at line 48 of file inlining_decorator.h.
|
private |
Definition at line 62 of file inlining_decorator.h.
|
private |
Definition at line 63 of file inlining_decorator.h.
|
private |
Definition at line 57 of file inlining_decorator.h.
|
private |
Definition at line 58 of file inlining_decorator.h.
|
private |
Definition at line 45 of file inlining_decorator.h.