cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
pointer_offset_sum.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Pointer Analysis
4
5
Author: Daniel Kroening, kroening@kroening.com
6
7
\*******************************************************************/
8
11
12
#include "
pointer_offset_sum.h
"
13
14
#include "
std_expr.h
"
15
16
exprt
pointer_offset_sum
(
const
exprt
&a,
const
exprt
&b)
17
{
18
if
(a.
id
() == ID_unknown)
19
return
a;
20
else
if
(b.
id
() == ID_unknown)
21
return
b;
22
else
if
(a == 0)
23
return
b;
24
else
if
(b == 0)
25
return
a;
26
27
return
plus_exprt
(a,
typecast_exprt::conditional_cast
(b, a.
type
()));
28
}
exprt
Base class for all expressions.
Definition
expr.h:57
exprt::type
typet & type()
Return the type of the expression.
Definition
expr.h:85
irept::id
const irep_idt & id() const
Definition
irep.h:388
plus_exprt
The plus expression Associativity is not specified.
Definition
std_expr.h:996
typecast_exprt::conditional_cast
static exprt conditional_cast(const exprt &expr, const typet &type)
Definition
std_expr.h:1993
pointer_offset_sum
exprt pointer_offset_sum(const exprt &a, const exprt &b)
Definition
pointer_offset_sum.cpp:16
pointer_offset_sum.h
Pointer Dereferencing.
std_expr.h
API to expression classes.
util
pointer_offset_sum.cpp
Generated by
1.17.0