CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
java_entry_point.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9
10#ifndef CPROVER_JAVA_BYTECODE_JAVA_ENTRY_POINT_H
11#define CPROVER_JAVA_BYTECODE_JAVA_ENTRY_POINT_H
12
13#include <util/irep.h>
14#include <util/symbol.h>
15
16class code_blockt; // IWYU pragma: keep
20
21#define JAVA_ENTRY_POINT_RETURN_SYMBOL "return'"
22#define JAVA_ENTRY_POINT_EXCEPTION_SYMBOL "uncaught_exception'"
23
25 std::function<std::pair<code_blockt, std::vector<exprt>>(
26 const symbolt &function,
27 symbol_table_baset &symbol_table)>;
28
78 class symbol_table_baset &symbol_table,
79 const irep_idt &main_class,
80 class message_handlert &message_handler,
82 bool assert_uncaught_exceptions,
83 const java_object_factory_parameterst &object_factory_parameters,
84 const select_pointer_typet &pointer_type_selector,
85 bool string_refinement_enabled,
87
89{
97
98 // Implicit conversion doesn't lose information and allows return of status
99 // NOLINTNEXTLINE(runtime/explicit)
103
104 // Implicit conversion doesn't lose information and allows return of symbol
105 // NOLINTNEXTLINE(runtime/explicit)
110
111 bool is_success() const
112 {
113 return status == Success;
114 }
115 bool is_error() const
116 {
117 return status == Error;
118 }
119};
120
138
141 const symbol_table_baset &symbol_table,
142 const irep_idt &main_class,
144
157 const symbolt &symbol,
158 class symbol_table_baset &symbol_table,
159 class message_handlert &message_handler,
160 bool assert_uncaught_exceptions,
161 const java_object_factory_parameterst &object_factory_parameters,
162 const select_pointer_typet &pointer_type_selector,
164
183std::pair<code_blockt, std::vector<exprt>> java_build_arguments(
184 const symbolt &function,
185 symbol_table_baset &symbol_table,
187 java_object_factory_parameterst object_factory_parameters,
188 const select_pointer_typet &pointer_type_selector,
189 message_handlert &message_handler);
190
194
197 symbol_table_baset &symbol_table,
198 const source_locationt &source_location,
200 java_object_factory_parameterst object_factory_parameters,
201 const select_pointer_typet &pointer_type_selector,
202 bool string_refinement_enabled,
203 message_handlert &message_handler);
204
205#endif // CPROVER_JAVA_BYTECODE_JAVA_ENTRY_POINT_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
A codet representing sequential composition of program statements.
Definition std_code.h:130
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
The symbol table base class interface.
Symbol table entry.
Definition symbol.h:28
bool generate_java_start_function(const symbolt &symbol, class symbol_table_baset &symbol_table, class message_handlert &message_handler, bool assert_uncaught_exceptions, const java_object_factory_parameterst &object_factory_parameters, const select_pointer_typet &pointer_type_selector, const build_argumentst &build_arguments)
Generate a _start function for a specific function.
bool java_entry_point(class symbol_table_baset &symbol_table, const irep_idt &main_class, class message_handlert &message_handler, bool assume_init_pointers_not_null, bool assert_uncaught_exceptions, const java_object_factory_parameterst &object_factory_parameters, const select_pointer_typet &pointer_type_selector, bool string_refinement_enabled, const build_argumentst &build_arguments)
Given the symbol_table and the main_class to test, this function generates a new function __CPROVER__...
void create_java_initialize(symbol_table_baset &symbol_table)
Adds __cprover_initialize to the symbol_table but does not generate code for it yet.
std::function< std::pair< code_blockt, std::vector< exprt > >(const symbolt &function, symbol_table_baset &symbol_table)> build_argumentst
void java_static_lifetime_init(symbol_table_baset &symbol_table, const source_locationt &source_location, bool assume_init_pointers_not_null, java_object_factory_parameterst object_factory_parameters, const select_pointer_typet &pointer_type_selector, bool string_refinement_enabled, message_handlert &message_handler)
Adds the body to __CPROVER_initialize.
main_function_resultt get_main_symbol(const symbol_table_baset &symbol_table, const irep_idt &main_class, message_handlert &)
Figures out the entry point of the code to verify.
irep_idt get_java_class_literal_initializer_signature()
Get the symbol name of java.lang.Class' initializer method.
std::pair< code_blockt, std::vector< exprt > > java_build_arguments(const symbolt &function, symbol_table_baset &symbol_table, bool assume_init_pointers_not_null, java_object_factory_parameterst object_factory_parameters, const select_pointer_typet &pointer_type_selector, message_handlert &message_handler)
main_function_resultt(const symbolt &main_function)
enum main_function_resultt::statust status
main_function_resultt(statust status)
Symbol table entry.