Skip to content

Commit e0ad069

Browse files
Merge pull request diffblue#1558 from NathanJPhillips/feature/complete-journalling_symbol_table
Complete journalling symbol table
2 parents 6dae8e8 + 69d1a52 commit e0ad069

28 files changed

+548
-469
lines changed

src/java_bytecode/java_bytecode_instrument.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ class java_bytecode_instrumentt:public messaget
2828
{
2929
public:
3030
java_bytecode_instrumentt(
31-
symbol_tablet &_symbol_table,
31+
symbol_table_baset &_symbol_table,
3232
const bool _throw_runtime_exceptions,
33-
message_handlert &_message_handler):
34-
messaget(_message_handler),
35-
symbol_table(_symbol_table),
36-
throw_runtime_exceptions(_throw_runtime_exceptions),
37-
message_handler(_message_handler)
38-
{
39-
}
33+
message_handlert &_message_handler)
34+
: messaget(_message_handler),
35+
symbol_table(_symbol_table),
36+
throw_runtime_exceptions(_throw_runtime_exceptions),
37+
message_handler(_message_handler)
38+
{
39+
}
4040

4141
void operator()(exprt &expr);
4242

4343
protected:
44-
symbol_tablet &symbol_table;
44+
symbol_table_baset &symbol_table;
4545
const bool throw_runtime_exceptions;
4646
message_handlert &message_handler;
4747

@@ -577,7 +577,7 @@ void java_bytecode_instrumentt::operator()(exprt &expr)
577577
/// this flag is set to true.
578578
/// \param message_handler: stream to report status and warnings
579579
void java_bytecode_instrument_symbol(
580-
symbol_tablet &symbol_table,
580+
symbol_table_baset &symbol_table,
581581
symbolt &symbol,
582582
const bool throw_runtime_exceptions,
583583
message_handlert &message_handler)

src/java_bytecode/java_bytecode_instrument.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Date: June 2017
1212
#define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INSTRUMENT_H
1313

1414
void java_bytecode_instrument_symbol(
15-
symbol_tablet &symbol_table,
15+
symbol_table_baset &symbol_table,
1616
symbolt &symbol,
1717
const bool throw_runtime_exceptions,
1818
message_handlert &_message_handler);

src/java_bytecode/java_bytecode_internal_additions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include <util/cprover_prefix.h>
1313
#include <util/c_types.h>
1414

15-
void java_internal_additions(symbol_tablet &dest)
15+
void java_internal_additions(symbol_table_baset &dest)
1616
{
1717
// add __CPROVER_rounding_mode
1818

src/java_bytecode/java_bytecode_internal_additions.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H
1111
#define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H
1212

13-
#include <util/symbol_table.h>
13+
#include <util/symbol_table_base.h>
1414

15-
void java_internal_additions(symbol_tablet &dest);
15+
void java_internal_additions(symbol_table_baset &dest);
1616

1717
#endif // CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H

src/java_bytecode/java_bytecode_language.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ void java_bytecode_languaget::convert_lazy_method(
355355
/// generated by string_preprocess.
356356
/// \param context: a symbol table
357357
void java_bytecode_languaget::replace_string_methods(
358-
symbol_tablet &context)
358+
symbol_table_baset &context)
359359
{
360360
// Symbols that have code type are potentialy to be replaced
361361
std::list<symbolt> code_symbols;
@@ -386,7 +386,7 @@ void java_bytecode_languaget::replace_string_methods(
386386
}
387387
}
388388

389-
bool java_bytecode_languaget::final(symbol_tablet &symbol_table)
389+
bool java_bytecode_languaget::final(symbol_table_baset &symbol_table)
390390
{
391391
PRECONDITION(language_options_initialized);
392392

src/java_bytecode/java_bytecode_language.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ class java_bytecode_languaget:public languaget
108108
symbol_tablet &context,
109109
const std::string &module) override;
110110

111-
void replace_string_methods(symbol_tablet &context);
111+
void replace_string_methods(symbol_table_baset &context);
112112

113-
virtual bool final(
114-
symbol_tablet &context) override;
113+
virtual bool final(symbol_table_baset &context) override;
115114

116115
void show_parse(std::ostream &out) override;
117116

src/java_bytecode/java_entry_point.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Author: Daniel Kroening, [email protected]
3636
#include "java_types.h"
3737
#include "java_utils.h"
3838

39-
static void create_initialize(symbol_tablet &symbol_table)
39+
static void create_initialize(symbol_table_baset &symbol_table)
4040
{
4141
// If __CPROVER_initialize already exists, replace it. It may already exist
4242
// if a GOTO binary provided it. This behaviour mirrors the ANSI-C frontend.
@@ -89,8 +89,8 @@ static bool is_non_null_library_global(const irep_idt &symbolid)
8989
return non_null_globals.count(symbolid);
9090
}
9191

92-
void java_static_lifetime_init(
93-
symbol_tablet &symbol_table,
92+
static void java_static_lifetime_init(
93+
symbol_table_baset &symbol_table,
9494
const source_locationt &source_location,
9595
bool assume_init_pointers_not_null,
9696
const object_factory_parameterst &object_factory_parameters,
@@ -162,7 +162,7 @@ void java_static_lifetime_init(
162162
exprt::operandst java_build_arguments(
163163
const symbolt &function,
164164
code_blockt &init_code,
165-
symbol_tablet &symbol_table,
165+
symbol_table_baset &symbol_table,
166166
bool assume_init_pointers_not_null,
167167
object_factory_parameterst object_factory_parameters,
168168
const select_pointer_typet &pointer_type_selector)
@@ -246,7 +246,7 @@ void java_record_outputs(
246246
const symbolt &function,
247247
const exprt::operandst &main_arguments,
248248
code_blockt &init_code,
249-
symbol_tablet &symbol_table)
249+
symbol_table_baset &symbol_table)
250250
{
251251
const code_typet::parameterst &parameters=
252252
to_code_type(function.type).parameters();
@@ -319,7 +319,7 @@ void java_record_outputs(
319319
}
320320

321321
main_function_resultt get_main_symbol(
322-
symbol_tablet &symbol_table,
322+
const symbol_table_baset &symbol_table,
323323
const irep_idt &main_class,
324324
message_handlert &message_handler,
325325
bool allow_no_body)
@@ -445,7 +445,7 @@ main_function_resultt get_main_symbol(
445445
///
446446
/// \returns true if error occurred on entry point search
447447
bool java_entry_point(
448-
symbol_tablet &symbol_table,
448+
symbol_table_baset &symbol_table,
449449
const irep_idt &main_class,
450450
message_handlert &message_handler,
451451
bool assume_init_pointers_not_null,
@@ -500,7 +500,7 @@ bool java_entry_point(
500500
/// \returns true if error occurred on entry point search, false otherwise
501501
bool generate_java_start_function(
502502
const symbolt &symbol,
503-
symbol_tablet &symbol_table,
503+
symbol_table_baset &symbol_table,
504504
message_handlert &message_handler,
505505
bool assume_init_pointers_not_null,
506506
const object_factory_parameterst& object_factory_parameters,

src/java_bytecode/java_entry_point.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#define JAVA_ENTRY_POINT_EXCEPTION_SYMBOL "uncaught_exception'"
2020

2121
bool java_entry_point(
22-
class symbol_tablet &symbol_table,
22+
class symbol_table_baset &symbol_table,
2323
const irep_idt &main_class,
2424
class message_handlert &message_handler,
2525
bool assume_init_pointers_not_null,
@@ -61,14 +61,14 @@ struct main_function_resultt
6161

6262
/// Figures out the entry point of the code to verify
6363
main_function_resultt get_main_symbol(
64-
symbol_tablet &symbol_table,
64+
const symbol_table_baset &symbol_table,
6565
const irep_idt &main_class,
6666
message_handlert &,
67-
bool allow_no_body=false);
67+
bool allow_no_body = false);
6868

6969
bool generate_java_start_function(
7070
const symbolt &symbol,
71-
class symbol_tablet &symbol_table,
71+
class symbol_table_baset &symbol_table,
7272
class message_handlert &message_handler,
7373
bool assume_init_pointers_not_null,
7474
const object_factory_parameterst& object_factory_parameters,

src/java_bytecode/java_object_factory.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Author: Daniel Kroening, [email protected]
3535
#include "java_root_class.h"
3636

3737
static symbolt &new_tmp_symbol(
38-
symbol_tablet &symbol_table,
38+
symbol_table_baset &symbol_table,
3939
const source_locationt &loc,
4040
const typet &type,
41-
const std::string &prefix="tmp_object_factory")
41+
const std::string &prefix = "tmp_object_factory")
4242
{
4343
return get_fresh_aux_symbol(
4444
type,
@@ -69,7 +69,7 @@ class java_object_factoryt
6969
std::unordered_set<irep_idt, irep_id_hash> recursion_set;
7070

7171
/// The symbol table.
72-
symbol_tablet &symbol_table;
72+
symbol_table_baset &symbol_table;
7373

7474
/// A namespace built from exclusively one symbol table - the one above.
7575
namespacet ns;
@@ -102,9 +102,9 @@ class java_object_factoryt
102102
std::vector<const symbolt *> &_symbols_created,
103103
const source_locationt &loc,
104104
const object_factory_parameterst _object_factory_parameters,
105-
symbol_tablet &_symbol_table,
106-
const select_pointer_typet &pointer_type_selector):
107-
symbols_created(_symbols_created),
105+
symbol_table_baset &_symbol_table,
106+
const select_pointer_typet &pointer_type_selector)
107+
: symbols_created(_symbols_created),
108108
loc(loc),
109109
object_factory_parameters(_object_factory_parameters),
110110
symbol_table(_symbol_table),
@@ -182,7 +182,7 @@ class java_object_factoryt
182182
exprt allocate_dynamic_object(
183183
const exprt &target_expr,
184184
const typet &allocate_type,
185-
symbol_tablet &symbol_table,
185+
symbol_table_baset &symbol_table,
186186
const source_locationt &loc,
187187
code_blockt &output_code,
188188
std::vector<const symbolt *> &symbols_created,
@@ -241,7 +241,7 @@ exprt allocate_dynamic_object(
241241
/// \param output_code: code block to which the necessary code is added
242242
void allocate_dynamic_object_with_decl(
243243
const exprt &target_expr,
244-
symbol_tablet &symbol_table,
244+
symbol_table_baset &symbol_table,
245245
const source_locationt &loc,
246246
code_blockt &output_code)
247247
{
@@ -543,7 +543,7 @@ codet initialize_nondet_string_struct(
543543
const exprt &obj,
544544
const std::size_t &max_nondet_string_length,
545545
const source_locationt &loc,
546-
symbol_tablet &symbol_table,
546+
symbol_table_baset &symbol_table,
547547
bool printable)
548548
{
549549
PRECONDITION(
@@ -636,7 +636,7 @@ static bool add_nondet_string_pointer_initialization(
636636
const exprt &expr,
637637
const std::size_t &max_nondet_string_length,
638638
bool printable,
639-
symbol_tablet &symbol_table,
639+
symbol_table_baset &symbol_table,
640640
const source_locationt &loc,
641641
code_blockt &code)
642642
{
@@ -1361,7 +1361,7 @@ exprt object_factory(
13611361
const irep_idt base_name,
13621362
code_blockt &init_code,
13631363
bool allow_null,
1364-
symbol_tablet &symbol_table,
1364+
symbol_table_baset &symbol_table,
13651365
const object_factory_parameterst &parameters,
13661366
allocation_typet alloc_type,
13671367
const source_locationt &loc,
@@ -1457,7 +1457,7 @@ exprt object_factory(
14571457
void gen_nondet_init(
14581458
const exprt &expr,
14591459
code_blockt &init_code,
1460-
symbol_tablet &symbol_table,
1460+
symbol_table_baset &symbol_table,
14611461
const source_locationt &loc,
14621462
bool skip_classid,
14631463
allocation_typet alloc_type,
@@ -1521,7 +1521,7 @@ exprt object_factory(
15211521
void gen_nondet_init(
15221522
const exprt &expr,
15231523
code_blockt &init_code,
1524-
symbol_tablet &symbol_table,
1524+
symbol_table_baset &symbol_table,
15251525
const source_locationt &loc,
15261526
bool skip_classid,
15271527
allocation_typet alloc_type,

src/java_bytecode/java_object_factory.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ exprt object_factory(
9191
const irep_idt base_name,
9292
code_blockt &init_code,
9393
bool allow_null,
94-
symbol_tablet &symbol_table,
94+
symbol_table_baset &symbol_table,
9595
const object_factory_parameterst &parameters,
9696
allocation_typet alloc_type,
9797
const source_locationt &location,
@@ -117,7 +117,7 @@ enum class update_in_placet
117117
void gen_nondet_init(
118118
const exprt &expr,
119119
code_blockt &init_code,
120-
symbol_tablet &symbol_table,
120+
symbol_table_baset &symbol_table,
121121
const source_locationt &loc,
122122
bool skip_classid,
123123
allocation_typet alloc_type,
@@ -129,7 +129,7 @@ void gen_nondet_init(
129129
void gen_nondet_init(
130130
const exprt &expr,
131131
code_blockt &init_code,
132-
symbol_tablet &symbol_table,
132+
symbol_table_baset &symbol_table,
133133
const source_locationt &loc,
134134
bool skip_classid,
135135
allocation_typet alloc_type,
@@ -140,23 +140,23 @@ void gen_nondet_init(
140140
exprt allocate_dynamic_object(
141141
const exprt &target_expr,
142142
const typet &allocate_type,
143-
symbol_tablet &symbol_table,
143+
symbol_table_baset &symbol_table,
144144
const source_locationt &loc,
145145
code_blockt &output_code,
146146
std::vector<const symbolt *> &symbols_created,
147-
bool cast_needed=false);
147+
bool cast_needed = false);
148148

149149
void allocate_dynamic_object_with_decl(
150150
const exprt &target_expr,
151-
symbol_tablet &symbol_table,
151+
symbol_table_baset &symbol_table,
152152
const source_locationt &loc,
153153
code_blockt &output_code);
154154

155155
codet initialize_nondet_string_struct(
156156
const exprt &obj,
157157
const std::size_t &max_nondet_string_length,
158158
const source_locationt &loc,
159-
symbol_tablet &symbol_table,
159+
symbol_table_baset &symbol_table,
160160
bool printable);
161161

162162
#endif // CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H

0 commit comments

Comments
 (0)