Skip to content

Commit 8236166

Browse files
thk123peterschrammel
thk123
authored andcommitted
Changes to get java compiling
1 parent 8dd297e commit 8236166

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

src/java_bytecode/java_entry_point.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include <util/irep.h>
1313

14+
#define JAVA_ENTRY_POINT_RETURN_SYMBOL "return'"
15+
1416
bool java_entry_point(
1517
class symbol_tablet &symbol_table,
1618
const irep_idt &main_class,

src/java_bytecode/java_object_factory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ void gen_nondet_init(
483483
bool create_dyn_objs,
484484
bool assume_non_null,
485485
message_handlert &message_handler,
486-
size_t max_nondet_array_length)
486+
size_t max_nondet_array_length,
487+
update_in_placet update_in_place)
487488
{
488489
java_object_factoryt state(
489490
init_code,

src/java_bytecode/java_object_factory.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ exprt object_factory(
2222
const source_locationt &,
2323
message_handlert &message_handler);
2424

25+
enum update_in_placet
26+
{
27+
NO_UPDATE_IN_PLACE,
28+
MAY_UPDATE_IN_PLACE,
29+
MUST_UPDATE_IN_PLACE
30+
};
31+
2532
void gen_nondet_init(
2633
const exprt &expr,
2734
code_blockt &init_code,
@@ -31,7 +38,8 @@ void gen_nondet_init(
3138
bool create_dynamic_objects,
3239
bool assume_non_null,
3340
message_handlert &message_handler,
34-
size_t max_nondet_array_length=5);
41+
size_t max_nondet_array_length,
42+
update_in_placet update_in_place=NO_UPDATE_IN_PLACE);
3543

3644

3745
exprt get_nondet_bool(const typet &);

src/java_bytecode/java_types.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Author: Daniel Kroening, [email protected]
99
#include <cassert>
1010
#include <cctype>
1111

12+
#include <util/prefix.h>
1213
#include <util/std_types.h>
1314
#include <util/std_expr.h>
1415
#include <util/ieee_float.h>
@@ -231,6 +232,23 @@ pointer_typet java_array_type(const char subtype)
231232

232233
/*******************************************************************\
233234
235+
Function: is_java_array_tag
236+
237+
Inputs: Struct tag 'tag'
238+
239+
Outputs: True if the given struct is a Java array
240+
241+
Purpose: See above
242+
243+
\*******************************************************************/
244+
245+
bool is_java_array_tag(const irep_idt& tag)
246+
{
247+
return has_prefix(id2string(tag), "java::array[");
248+
}
249+
250+
/*******************************************************************\
251+
234252
Function: is_reference_type
235253
236254
Inputs:

src/java_bytecode/java_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ char java_char_from_type(const typet &type);
4444
typet java_bytecode_promotion(const typet &);
4545
exprt java_bytecode_promotion(const exprt &);
4646

47+
bool is_java_array_tag(const irep_idt& tag);
48+
4749
#endif // CPROVER_JAVA_BYTECODE_JAVA_TYPES_H

0 commit comments

Comments
 (0)