CBMC
find_symbols.cpp File Reference
#include "find_symbols.h"
#include "c_types.h"
#include "std_expr.h"
+ Include dependency graph for find_symbols.cpp:

Go to the source code of this file.

Enumerations

enum class  symbol_kindt {
  F_TYPE , F_TYPE_NON_PTR , F_EXPR , F_EXPR_FREE ,
  F_ALL
}
 Kinds of symbols to be considered by find_symbols. More...
 

Functions

static bool find_symbols (symbol_kindt, const typet &, std::function< bool(const symbol_exprt &)>, std::unordered_set< irep_idt > &bindings)
 
static bool find_symbols (symbol_kindt kind, const exprt &src, std::function< bool(const symbol_exprt &)> op, std::unordered_set< irep_idt > &bindings)
 
static bool find_symbols (symbol_kindt kind, const typet &type, std::function< bool(const symbol_exprt &)> op)
 
static bool find_symbols (symbol_kindt kind, const exprt &src, std::function< bool(const symbol_exprt &)> op)
 
void find_symbols (const exprt &src, std::set< symbol_exprt > &dest)
 Find sub expressions with id ID_symbol, considering both free and bound variables. More...
 
bool has_symbol_expr (const exprt &src, const irep_idt &identifier, bool include_bound_symbols)
 Returns true if one of the symbol expressions in src has identifier identifier; if include_bound_symbols is true, then bindings are included in the search. More...
 
void find_type_symbols (const exprt &src, find_symbols_sett &dest)
 Collect all type tags contained in src and add them to dest. More...
 
void find_type_symbols (const typet &src, find_symbols_sett &dest)
 Collect all type tags contained in src and add them to dest. More...
 
void find_non_pointer_type_symbols (const exprt &src, find_symbols_sett &dest)
 Collect type tags contained in src when the expression of such a type is not a pointer, and add them to dest. More...
 
void find_non_pointer_type_symbols (const typet &src, find_symbols_sett &dest)
 Collect type tags contained in src when the expression of such a type is not a pointer, and add them to dest. More...
 
void find_type_and_expr_symbols (const exprt &src, find_symbols_sett &dest)
 Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables, as well as any type tags. More...
 
void find_type_and_expr_symbols (const typet &src, find_symbols_sett &dest)
 Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables, as well as any type tags. More...
 
void find_symbols (const exprt &src, find_symbols_sett &dest)
 Add to the set dest the sub-expressions of src with id ID_symbol, for both free and bound variables. More...
 

Enumeration Type Documentation

◆ symbol_kindt

enum symbol_kindt
strong

Kinds of symbols to be considered by find_symbols.

Enumerator
F_TYPE 

Struct, union, or enum tag symbols.

F_TYPE_NON_PTR 

Struct, union, or enum tag symbols when the expression using them is not a pointer.

F_EXPR 

Symbol expressions.

F_EXPR_FREE 

Symbol expressions, but excluding bound variables.

F_ALL 

All of the above.

Definition at line 15 of file find_symbols.cpp.

Function Documentation

◆ find_non_pointer_type_symbols() [1/2]

void find_non_pointer_type_symbols ( const exprt src,
find_symbols_sett dest 
)

Collect type tags contained in src when the expression of such a type is not a pointer, and add them to dest.

Definition at line 259 of file find_symbols.cpp.

◆ find_non_pointer_type_symbols() [2/2]

void find_non_pointer_type_symbols ( const typet src,
find_symbols_sett dest 
)

Collect type tags contained in src when the expression of such a type is not a pointer, and add them to dest.

Definition at line 270 of file find_symbols.cpp.

◆ find_symbols() [1/6]

void find_symbols ( const exprt src,
find_symbols_sett dest 
)

Add to the set dest the sub-expressions of src with id ID_symbol, for both free and bound variables.

Definition at line 297 of file find_symbols.cpp.

◆ find_symbols() [2/6]

void find_symbols ( const exprt src,
std::set< symbol_exprt > &  dest 
)

Find sub expressions with id ID_symbol, considering both free and bound variables.

Definition at line 222 of file find_symbols.cpp.

◆ find_symbols() [3/6]

static bool find_symbols ( symbol_kindt  kind,
const exprt src,
std::function< bool(const symbol_exprt &)>  op 
)
static

Definition at line 213 of file find_symbols.cpp.

◆ find_symbols() [4/6]

static bool find_symbols ( symbol_kindt  kind,
const exprt src,
std::function< bool(const symbol_exprt &)>  op,
std::unordered_set< irep_idt > &  bindings 
)
static

Definition at line 36 of file find_symbols.cpp.

◆ find_symbols() [5/6]

static bool find_symbols ( symbol_kindt  kind,
const typet type,
std::function< bool(const symbol_exprt &)>  op 
)
static

Definition at line 204 of file find_symbols.cpp.

◆ find_symbols() [6/6]

static bool find_symbols ( symbol_kindt  kind,
const typet src,
std::function< bool(const symbol_exprt &)>  op,
std::unordered_set< irep_idt > &  bindings 
)
static

Definition at line 120 of file find_symbols.cpp.

◆ find_type_and_expr_symbols() [1/2]

void find_type_and_expr_symbols ( const exprt src,
find_symbols_sett dest 
)

Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables, as well as any type tags.

Definition at line 281 of file find_symbols.cpp.

◆ find_type_and_expr_symbols() [2/2]

void find_type_and_expr_symbols ( const typet src,
find_symbols_sett dest 
)

Find identifiers of the sub expressions with id ID_symbol, considering both free and bound variables, as well as any type tags.

Definition at line 289 of file find_symbols.cpp.

◆ find_type_symbols() [1/2]

void find_type_symbols ( const exprt src,
find_symbols_sett dest 
)

Collect all type tags contained in src and add them to dest.

Definition at line 243 of file find_symbols.cpp.

◆ find_type_symbols() [2/2]

void find_type_symbols ( const typet src,
find_symbols_sett dest 
)

Collect all type tags contained in src and add them to dest.

Definition at line 251 of file find_symbols.cpp.

◆ has_symbol_expr()

bool has_symbol_expr ( const exprt src,
const irep_idt identifier,
bool  include_bound_symbols 
)

Returns true if one of the symbol expressions in src has identifier identifier; if include_bound_symbols is true, then bindings are included in the search.

Definition at line 230 of file find_symbols.cpp.