|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Irep for various side effects. More...
#include <irep2_expr.h>
Public Types | |
| using | allockind = sideeffect_allockind |
| Public Types inherited from expr2t | |
| enum | expr_ids { end_expr_id } |
| Enumeration identifying each sort of expr. More... | |
| typedef esbmct::function_ref< void(const expr2tc &)> | const_op_delegate |
| typedef esbmct::function_ref< void(expr2tc &)> | op_delegate |
| typedef expr2tc | container_type |
| typedef expr2t | base_type |
Public Member Functions | |
| sideeffect2t (const type2tc &t, const expr2tc &oper, const expr2tc &sz, const std::vector< expr2tc > &a, const type2tc &alloct, sideeffect_allockind k, const locationt &loc=locationt(), bool ctor=false) | |
| Primary constructor. | |
| sideeffect2t (const sideeffect2t &ref)=default | |
| Public Member Functions inherited from expr2t | |
| virtual | ~expr2t ()=default |
| expr2tc | clone () const |
| expr2tc | with_type (const type2tc &new_type) const |
| Build a fresh expression of the same kind and field values as this one, but with a different type. | |
| bool | operator== (const expr2t &ref) const |
| bool | operator< (const expr2t &ref) const |
| bool | operator!= (const expr2t &ref) const |
| std::string | pretty (unsigned int indent=0) const |
| Produce textual representation of this expr. | |
| DUMP_METHOD void | dump () const |
| Write textual representation of this object to stdout. | |
| size_t | crc () const |
| Calculate a hash/digest of the current expr. | |
| bool | cmp (const expr2t &ref) const |
| Structural comparison. | |
| int | lt (const expr2t &ref) const |
| Trinary structural ordering. | |
| list_of_memberst | tostring (unsigned int indent) const |
| Convert fields of subclasses to a string representation. | |
| const expr2tc * | get_sub_expr (size_t idx) const |
| Fetch a sub-operand. | |
| size_t | get_num_sub_exprs () const |
| Count the number of sub-exprs there are. | |
| expr2tc | simplify () const |
| Simplify an expression. | |
| expr2tc | simplify (bool suppress_reassoc) const |
| Simplify with reassociation suppression. | |
| virtual expr2tc | do_simplify () const |
| expr-specific simplification methods. | |
| template<typename T> | |
| void | foreach_operand (T &&t) const |
| Indirect, abstract operand iteration. | |
| template<typename T> | |
| void | Foreach_operand (T &&t) |
| Public Member Functions inherited from irep2t | |
| irep2t () noexcept | |
| irep2t (const irep2t &) noexcept | |
| irep2t & | operator= (const irep2t &)=delete |
| virtual | ~irep2t ()=default |
| void | mark_writer () const noexcept |
| void | clear_writer () const noexcept |
Public Attributes | |
| expr2tc | operand |
| expr2tc | size |
| std::vector< expr2tc > | arguments |
| type2tc | alloctype |
| sideeffect_allockind | kind |
| bool | constructor |
| This call constructs an object. | |
| locationt | location |
| Public Attributes inherited from expr2t | |
| const expr_ids | expr_id |
| Instance of expr_ids recording tihs exprs type. | |
| const type2tc | type |
| Type of this expr. | |
| std::atomic< size_t > | crc_val |
| Public Attributes inherited from irep2t | |
| std::atomic< unsigned int > | refcount |
| std::atomic< std::uintptr_t > | writer_thread |
Static Public Attributes | |
| static constexpr std::size_t | excluded_field_bytes = sizeof(locationt) |
| static constexpr auto | fields |
| static std::string | field_names [esbmct::num_type_fields] |
Additional Inherited Members | |
| Static Public Member Functions inherited from irep2t | |
| static std::uintptr_t | current_thread_tag () noexcept |
| Protected Member Functions inherited from expr2t | |
| expr2t (const type2tc &type, expr_ids id) | |
| Primary constructor. | |
| expr2t (const expr2t &ref) | |
| Copy constructor. | |
| void | foreach_operand_impl_const (const_op_delegate &expr) const |
| void | foreach_operand_impl (op_delegate &expr) |
Irep for various side effects.
Stores data about various things that can cause side effects, such as memory allocations, nondeterministic value allocations (nondet_* funcs,).
Also allows for function-calls to be represented. This side-effect expression is how function calls inside expressions are represented during parsing, and are all flattened out prior to GOTO program creation. However, under certain circumstances irep2 needs to represent such function calls, so this facility is preserved in irep2.
|
inline |
Primary constructor.
| t | Type this side-effect evaluates to. |
| operand | Not really certain. Sometimes turns up in string-irep. |
| sz | Size of dynamic allocation to make. |
| alloct | Type of piece of data to allocate. |
| a | Vector of arguments to function call. |
| loc | Source position of the side effect itself. A call in a sub-expression is the case that needs it: the enclosing statement's location names the statement, not the callee, so a consumer that falls back to it reports the wrong column (scope-clang-c-irep2.md §110.3). |
|
default |
| type2tc sideeffect2t::alloctype |
| std::vector<expr2tc> sideeffect2t::arguments |
| bool sideeffect2t::constructor |
This call constructs an object.
The converter's #constructor marker, which has nowhere else to live in IREP2 – the callee's constructor return type migrates to empty (migrate.cpp) and cannot be restored from it. clang_cpp_maint::adjust_init reads the marker after this pass, so a body written back without it loses a global's construction (docs/roadmap/scope-clang-cpp-irep2.md §3.17).
Declared next to kind, where it packs into existing padding, and not reflected: listing it in fields makes the primary constructor's parameter order stop matching the field order (location sits between), which is what supports_with_type_v tests – with_type then rejects every side effect at run time. Like location, it is therefore carried but not compared, and dropped by a with_type rebuild, which reconstructs from fields alone.
|
staticconstexpr |
|
static |
|
staticconstexpr |
| sideeffect_allockind sideeffect2t::kind |
| locationt sideeffect2t::location |
| expr2tc sideeffect2t::operand |
| expr2tc sideeffect2t::size |