CBMC: /home/runner/work/cbmc/cbmc/src/util/std_code_base.h Source File

1

2

3

4

5

6

7

8

9#ifndef CPROVER_UTIL_STD_CODE_BASE_H

10#define CPROVER_UTIL_STD_CODE_BASE_H

11

16

29{

30public:

38

44

53

55 : codet(statement, std::move(loc))

56 {

58 }

59

64

69

74

79};

80

81namespace detail

82{

83template <typename Tag>

85{

87 {

88 return ptr->get_statement() == tag;

89 }

90 return false;

91}

92

93}

94

95template <>

100

101

102

103

105{

107 return static_cast<const codet &>(expr);

108}

109

111{

113 return static_cast<codet &>(expr);

114}

115

116#endif

ait supplies three of the four components needed: an abstract interpreter (in this case handling func...

Data structure for representing an arbitrary statement in a program.

codet(const irep_idt &statement, source_locationt loc)

codet(const irep_idt &statement)

codet(const irep_idt &statement, operandst op, source_locationt loc)

codet & first_statement()

In the case of a codet type that represents multiple statements, return the first of them.

codet & last_statement()

In the case of a codet type that represents multiple statements, return the last of them.

const irep_idt & get_statement() const

void set_statement(const irep_idt &statement)

codet(const irep_idt &statement, operandst _op)

dstringt has one field, an unsigned integer no which is an index into a static table of strings.

Base class for all expressions.

std::vector< exprt > operandst

const irep_idt & get(const irep_idt &name) const

void set(const irep_idt &name, const irep_idt &value)

const irep_idt & id() const

Templated functions to cast to specific exprt-derived classes.

bool can_cast_code_impl(const exprt &expr, const Tag &tag)

#define PRECONDITION(CONDITION)

bool can_cast_expr< codet >(const exprt &base)

const codet & to_code(const exprt &expr)