cprover
java_bytecode_internal_additions.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
10 
11 // For INFLIGHT_EXCEPTION_VARIABLE_NAME
12 #include "remove_exceptions.h"
13 
14 #include <util/std_types.h>
15 #include <util/cprover_prefix.h>
16 #include <util/c_types.h>
17 
19 {
20  // add __CPROVER_rounding_mode
21 
22  {
23  symbolt symbol;
24  symbol.base_name = CPROVER_PREFIX "rounding_mode";
25  symbol.name=CPROVER_PREFIX "rounding_mode";
26  symbol.type=signed_int_type();
27  symbol.mode=ID_C;
28  symbol.is_lvalue=true;
29  symbol.is_state_var=true;
30  symbol.is_thread_local=true;
31  dest.add(symbol);
32  }
33 
34  // add __CPROVER_malloc_object
35 
36  {
37  symbolt symbol;
38  symbol.base_name = CPROVER_PREFIX "malloc_object";
39  symbol.name=CPROVER_PREFIX "malloc_object";
40  symbol.type=pointer_type(empty_typet());
41  symbol.mode=ID_C;
42  symbol.is_lvalue=true;
43  symbol.is_state_var=true;
44  symbol.is_thread_local=true;
45  dest.add(symbol);
46  }
47 
48  {
49  auxiliary_symbolt symbol;
52  symbol.mode = ID_java;
53  symbol.type = pointer_type(empty_typet());
54  symbol.type.set(ID_C_no_nondet_initialization, true);
55  symbol.value = null_pointer_exprt(to_pointer_type(symbol.type));
56  symbol.is_file_local = false;
57  symbol.is_static_lifetime = true;
58  dest.add(symbol);
59  }
60 }
symbolt::is_state_var
bool is_state_var
Definition: symbol.h:61
INFLIGHT_EXCEPTION_VARIABLE_BASENAME
#define INFLIGHT_EXCEPTION_VARIABLE_BASENAME
Definition: remove_exceptions.h:22
symbolt::type
typet type
Type of symbol.
Definition: symbol.h:31
symbolt::base_name
irep_idt base_name
Base (non-scoped) name.
Definition: symbol.h:46
auxiliary_symbolt
Internally generated symbol table entry.
Definition: symbol.h:148
symbolt::is_thread_local
bool is_thread_local
Definition: symbol.h:65
symbolt::mode
irep_idt mode
Language mode.
Definition: symbol.h:49
empty_typet
The empty type.
Definition: std_types.h:48
signed_int_type
signedbv_typet signed_int_type()
Definition: c_types.cpp:30
null_pointer_exprt
The null pointer constant.
Definition: std_expr.h:4471
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:21
std_types.h
INFLIGHT_EXCEPTION_VARIABLE_NAME
#define INFLIGHT_EXCEPTION_VARIABLE_NAME
Definition: remove_exceptions.h:23
java_bytecode_internal_additions.h
pointer_type
pointer_typet pointer_type(const typet &subtype)
Definition: c_types.cpp:243
to_pointer_type
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
Definition: std_types.h:1544
cprover_prefix.h
remove_exceptions.h
symbol_table_baset::add
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
Definition: symbol_table_base.cpp:18
symbolt::value
exprt value
Initial value of symbol.
Definition: symbol.h:34
java_internal_additions
void java_internal_additions(symbol_table_baset &dest)
Definition: java_bytecode_internal_additions.cpp:18
symbolt
Symbol table entry.
Definition: symbol.h:27
irept::set
void set(const irep_namet &name, const irep_idt &value)
Definition: irep.h:286
CPROVER_PREFIX
#define CPROVER_PREFIX
Definition: cprover_prefix.h:14
symbolt::is_static_lifetime
bool is_static_lifetime
Definition: symbol.h:65
symbolt::is_file_local
bool is_file_local
Definition: symbol.h:66
symbolt::is_lvalue
bool is_lvalue
Definition: symbol.h:66
c_types.h
symbolt::name
irep_idt name
The unique identifier.
Definition: symbol.h:40