cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp_typecheck_fargs.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: C++ Language Type Checking
4
5
Author: Daniel Kroening, kroening@cs.cmu.edu
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_CPP_CPP_TYPECHECK_FARGS_H
13
#define CPROVER_CPP_CPP_TYPECHECK_FARGS_H
14
15
#include <
util/expr.h
>
16
17
class
code_typet
;
18
class
cpp_typecheckt
;
19
class
side_effect_expr_function_callt
;
20
21
class
cpp_typecheck_fargst
// for function overloading
22
{
23
public
:
24
bool
in_use
,
has_object
;
25
exprt::operandst
operands
;
26
27
// has_object indicates that the first element of
28
// 'operands' is the 'this' pointer (with the object type,
29
// not pointer to object type)
30
31
cpp_typecheck_fargst
():
in_use
(false),
has_object
(false) { }
32
33
bool
has_class_type
()
const
;
34
35
void
build
(
36
const
side_effect_expr_function_callt
&function_call);
37
38
explicit
cpp_typecheck_fargst
(
39
const
side_effect_expr_function_callt
&function_call):
40
in_use
(false),
has_object
(false)
41
{
42
build
(function_call);
43
}
44
45
bool
match
(
46
const
code_typet
&code_type,
47
unsigned
&distance,
48
cpp_typecheckt
&
cpp_typecheck
)
const
;
49
50
void
add_object
(
const
exprt
&expr)
51
{
52
// if(!in_use) return;
53
has_object
=
true
;
54
operands
.insert(
operands
.begin(), expr);
55
}
56
57
void
remove_object
()
58
{
59
PRECONDITION
(
has_object
);
60
operands
.erase(
operands
.begin());
61
has_object
=
false
;
62
}
63
};
64
65
#endif
// CPROVER_CPP_CPP_TYPECHECK_FARGS_H
code_typet
Base type of functions.
Definition
std_types.h:583
cpp_typecheck_fargst::operands
exprt::operandst operands
Definition
cpp_typecheck_fargs.h:25
cpp_typecheck_fargst::cpp_typecheck_fargst
cpp_typecheck_fargst(const side_effect_expr_function_callt &function_call)
Definition
cpp_typecheck_fargs.h:38
cpp_typecheck_fargst::remove_object
void remove_object()
Definition
cpp_typecheck_fargs.h:57
cpp_typecheck_fargst::in_use
bool in_use
Definition
cpp_typecheck_fargs.h:24
cpp_typecheck_fargst::match
bool match(const code_typet &code_type, unsigned &distance, cpp_typecheckt &cpp_typecheck) const
Definition
cpp_typecheck_fargs.cpp:36
cpp_typecheck_fargst::has_class_type
bool has_class_type() const
Definition
cpp_typecheck_fargs.cpp:18
cpp_typecheck_fargst::build
void build(const side_effect_expr_function_callt &function_call)
Definition
cpp_typecheck_fargs.cpp:29
cpp_typecheck_fargst::cpp_typecheck_fargst
cpp_typecheck_fargst()
Definition
cpp_typecheck_fargs.h:31
cpp_typecheck_fargst::add_object
void add_object(const exprt &expr)
Definition
cpp_typecheck_fargs.h:50
cpp_typecheck_fargst::has_object
bool has_object
Definition
cpp_typecheck_fargs.h:24
cpp_typecheckt
Definition
cpp_typecheck.h:43
exprt
Base class for all expressions.
Definition
expr.h:57
exprt::operandst
std::vector< exprt > operandst
Definition
expr.h:59
side_effect_expr_function_callt
A side_effect_exprt representation of a function call side effect.
Definition
std_code.h:1692
cpp_typecheck
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
Definition
cpp_typecheck.cpp:137
expr.h
PRECONDITION
#define PRECONDITION(CONDITION)
Definition
invariant.h:463
cpp
cpp_typecheck_fargs.h
Generated by
1.17.0