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 | ) |
Referenced by DISABLE_COPY_AND_ASSIGN().
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 |
References known_function_manager().
|
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 m_logger.
Referenced by set_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 m_logger.
Referenced by set_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 m_logger.
Referenced by set_logger().
|
private |
|
private |
const known_function * ana::known_function_manager::get_internal_fn | ( | enum | internal_fn | ) | const |
|
inlineinherited |
References gcc_assert, get_logger_pp(), and m_logger.
Referenced by get_logger_pp().
const known_function * ana::known_function_manager::get_match | ( | tree | fndecl, |
const call_details & | cd ) const |
References cd.
|
private |
|
private |
|
inlineinherited |
|
inherited |
References ATTRIBUTE_GCC_DIAG, end_log_line(), enter_scope(), exit_scope(), and start_log_line().
|
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 m_logger.
Referenced by set_logger().
|
private |
|
privateinherited |
Referenced by end_log_line(), enter_scope(), exit_scope(), get_logger(), get_logger_file(), get_logger_pp(), log(), and start_log_line().
|
private |
|
private |