File tree 4 files changed +59
-0
lines changed 4 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,26 @@ void java_bytecode_languaget::modules_provided(std::set<std::string> &modules)
106
106
// modules.insert(translation_unit(parse_path));
107
107
}
108
108
109
+ // / Generate a _start function for a specific function.
110
+ // / \param entry_function_symbol: The symbol for the function that should be
111
+ // / used as the entry point
112
+ // / \param symbol_table: The symbol table for the program. The new _start
113
+ // / function symbol will be added to this table
114
+ // / \return Returns false if the _start method was generated correctly
115
+ bool java_bytecode_languaget::generate_start_function (
116
+ const symbolt &entry_function_symbol,
117
+ symbol_tablet &symbol_table)
118
+ {
119
+ return generate_java_start_function (
120
+ entry_function_symbol,
121
+ symbol_table,
122
+ get_message_handler (),
123
+ assume_inputs_non_null,
124
+ max_nondet_array_length,
125
+ max_nondet_tree_depth,
126
+ *pointer_type_selector);
127
+ }
128
+
109
129
// / ANSI-C preprocessing
110
130
bool java_bytecode_languaget::preprocess (
111
131
std::istream &instream,
Original file line number Diff line number Diff line change @@ -137,6 +137,10 @@ class java_bytecode_languaget:public languaget
137
137
virtual void convert_lazy_method (
138
138
const irep_idt &id, symbol_tablet &) override ;
139
139
140
+ virtual bool generate_start_function (
141
+ const class symbolt &entry_function_symbol,
142
+ class symbol_tablet &symbol_table) override ;
143
+
140
144
protected:
141
145
bool do_ci_lazy_method_conversion (symbol_tablet &, lazy_methodst &);
142
146
const select_pointer_typet &get_pointer_type_selector () const ;
Original file line number Diff line number Diff line change @@ -510,6 +510,32 @@ bool java_entry_point(
510
510
max_nondet_tree_depth,
511
511
pointer_type_selector);
512
512
513
+ return generate_java_start_function (
514
+ symbol,
515
+ symbol_table,
516
+ message_handler,
517
+ assume_init_pointers_not_null,
518
+ max_nondet_array_length,
519
+ max_nondet_tree_depth,
520
+ pointer_type_selector);
521
+ }
522
+
523
+ // / Generate a _start function for a specific function
524
+ // / \param entry_function_symbol: The symbol for the function that should be
525
+ // / used as the entry point
526
+ // / \param symbol_table: The symbol table for the program. The new _start
527
+ // / function symbol will be added to this table
528
+ // / \return Returns false if the _start method was generated correctly
529
+ bool generate_java_start_function (
530
+ const symbolt &symbol,
531
+ symbol_tablet &symbol_table,
532
+ message_handlert &message_handler,
533
+ bool assume_init_pointers_not_null,
534
+ size_t max_nondet_array_length,
535
+ size_t max_nondet_tree_depth,
536
+ const select_pointer_typet &pointer_type_selector)
537
+ {
538
+ messaget message (message_handler);
513
539
code_blockt init_code;
514
540
515
541
// build call to initialization function
Original file line number Diff line number Diff line change @@ -40,4 +40,13 @@ main_function_resultt get_main_symbol(
40
40
message_handlert &,
41
41
bool allow_no_body=false );
42
42
43
+ bool generate_java_start_function (
44
+ const symbolt &symbol,
45
+ class symbol_tablet &symbol_table,
46
+ class message_handlert &message_handler,
47
+ bool assume_init_pointers_not_null,
48
+ size_t max_nondet_array_length,
49
+ size_t max_nondet_tree_depth,
50
+ const select_pointer_typet &pointer_type_selector);
51
+
43
52
#endif // CPROVER_JAVA_BYTECODE_JAVA_ENTRY_POINT_H
You can’t perform that action at this time.
0 commit comments