GCC Middle and Back End API Reference
|
#include <known-function-manager.h>
Public Member Functions | |
known_function_manager (logger *logger) | |
~known_function_manager () | |
void | add (const char *name, std::unique_ptr< known_function > kf) |
void | add_std_ns (const char *name, std::unique_ptr< known_function > kf) |
void | add (enum built_in_function name, std::unique_ptr< known_function > kf) |
void | add (enum internal_fn ifn, std::unique_ptr< known_function > kf) |
const known_function * | get_match (tree fndecl, const call_details &cd) const |
const known_function * | get_internal_fn (enum internal_fn) const |
logger * | get_logger () const |
void | set_logger (logger *logger) |
void | log (const char *fmt,...) const ATTRIBUTE_GCC_DIAG(2 |
void void | start_log_line () const |
void | end_log_line () const |
void | enter_scope (const char *scope_name) |
void | exit_scope (const char *scope_name) |
pretty_printer * | get_logger_pp () const |
FILE * | get_logger_file () const |
Private Member Functions | |
DISABLE_COPY_AND_ASSIGN (known_function_manager) | |
const known_function * | get_normal_builtin (enum built_in_function name) const |
const known_function * | get_normal_builtin (const builtin_known_function *builtin_kf) const |
const known_function * | get_by_identifier (tree identifier) const |
const known_function * | get_by_identifier_in_std_ns (tree identifier) const |
Private Attributes | |
hash_map< tree, known_function * > | m_map_id_to_kf |
hash_map< tree, known_function * > | m_std_ns_map_id_to_kf |
known_function * | m_combined_fns_arr [CFN_LAST] |
logger * | m_logger |
Instances of known_function are registered with the known_function_manager when the analyzer starts. The known_function_manager has responsibility for determining which known_function instance (if any) is relevant at a call site, by checking name or id, and by calling known_function::matches_call_types_p to ensure that the known_function's preconditions hold (typically assumptions about types e.g. that "has 3 args, and that arg 0 is of pointer type"). The known_function subclasses themselves have responsibility for determining the outcome(s) of the call.
ana::known_function_manager::known_function_manager | ( | logger * | logger | ) |
ana::known_function_manager::~known_function_manager | ( | ) |
void ana::known_function_manager::add | ( | const char * | name, |
std::unique_ptr< known_function > | kf ) |
void ana::known_function_manager::add | ( | enum built_in_function | name, |
std::unique_ptr< known_function > | kf ) |
void ana::known_function_manager::add | ( | enum internal_fn | ifn, |
std::unique_ptr< known_function > | kf ) |
void ana::known_function_manager::add_std_ns | ( | const char * | name, |
std::unique_ptr< known_function > | kf ) |
|
private |
|
inlineinherited |
A shortcut for ending a log line from a log_user, handling the common case where the underlying logger is NULL via a no-op.
References ana::logger::end_log_line(), and ana::log_user::m_logger.
|
inlineinherited |
A shortcut for recording entry into a scope from a log_user, handling the common case where the underlying logger is NULL via a no-op.
References ana::logger::enter_scope(), and ana::log_user::m_logger.
|
inlineinherited |
A shortcut for recording exit from a scope from a log_user, handling the common case where the underlying logger is NULL via a no-op.
References ana::logger::exit_scope(), and ana::log_user::m_logger.
|
private |
|
private |
const known_function * ana::known_function_manager::get_internal_fn | ( | enum | internal_fn | ) | const |
|
inlineinherited |
References ana::log_user::m_logger.
Referenced by ana::exploded_graph::get_logger(), and ana::impl_region_model_context::get_logger().
|
inlineinherited |
References ana::logger::get_file(), ana::log_user::m_logger, and NULL.
|
inlineinherited |
References gcc_assert, ana::logger::get_printer(), and ana::log_user::m_logger.
const known_function * ana::known_function_manager::get_match | ( | tree | fndecl, |
const call_details & | cd ) const |
|
private |
|
private |
|
inlineinherited |
A shortcut for calling log from a log_user, handling the common case where the underlying logger is NULL via a no-op.
References ap, ana::logger::log_va(), and ana::log_user::m_logger.
|
inherited |
|
inlineinherited |
A shortcut for starting a log line from a log_user, handling the common case where the underlying logger is NULL via a no-op.
References ana::log_user::m_logger, and ana::logger::start_log_line().
|
private |
|
privateinherited |
|
private |
|
private |