cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
does_remove_const.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Analyses
4
5
Author: Diffblue Ltd.
6
7
\*******************************************************************/
10
11
#ifndef CPROVER_ANALYSES_DOES_REMOVE_CONST_H
12
#define CPROVER_ANALYSES_DOES_REMOVE_CONST_H
13
14
#include <utility>
15
16
class
goto_programt
;
17
class
exprt
;
18
class
source_locationt
;
19
class
typet
;
20
21
class
does_remove_constt
22
{
23
public
:
24
explicit
does_remove_constt
(
const
goto_programt
&);
25
std::pair<bool, source_locationt>
operator()
()
const
;
26
27
private
:
28
bool
does_expr_lose_const
(
const
exprt
&expr)
const
;
29
30
bool
is_type_at_least_as_const_as
(
31
const
typet
&type_more_const,
const
typet
&type_compare)
const
;
32
33
bool
does_type_preserve_const_correctness
(
34
const
typet
*target_type,
const
typet
*source_type)
const
;
35
36
const
goto_programt
&
goto_program
;
37
38
friend
class
does_remove_const_testt
;
39
};
40
41
#endif
// CPROVER_ANALYSES_DOES_REMOVE_CONST_H
does_remove_constt::is_type_at_least_as_const_as
bool is_type_at_least_as_const_as(const typet &type_more_const, const typet &type_compare) const
A simple check to check the type_more_const is at least as const as type compare.
Definition
does_remove_const.cpp:158
does_remove_constt::does_remove_const_testt
friend class does_remove_const_testt
Definition
does_remove_const.h:38
does_remove_constt::does_type_preserve_const_correctness
bool does_type_preserve_const_correctness(const typet *target_type, const typet *source_type) const
A recursive check that handles when assigning a source value to a target, is the assignment a loss of...
Definition
does_remove_const.cpp:114
does_remove_constt::does_remove_constt
does_remove_constt(const goto_programt &)
A naive analysis to look for casts that remove const-ness from pointers.
Definition
does_remove_const.cpp:20
does_remove_constt::operator()
std::pair< bool, source_locationt > operator()() const
A naive analysis to look for casts that remove const-ness from pointers.
Definition
does_remove_const.cpp:26
does_remove_constt::goto_program
const goto_programt & goto_program
Definition
does_remove_const.h:36
does_remove_constt::does_expr_lose_const
bool does_expr_lose_const(const exprt &expr) const
Search the expression tree to look for any children that have the same base type, but a less strict c...
Definition
does_remove_const.cpp:61
exprt
Base class for all expressions.
Definition
expr.h:57
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition
goto_program.h:72
source_locationt
Definition
source_location.h:20
typet
The type of an expression, extends irept.
Definition
type.h:29
analyses
does_remove_const.h
Generated by
1.17.0