-
Notifications
You must be signed in to change notification settings - Fork 274
Complete journalling symbol table #1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
peterschrammel
merged 7 commits into
diffblue:develop
from
NathanJPhillips:feature/complete-journalling_symbol_table
Nov 15, 2017
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8035397
Style improvements
NathanJPhillips 2ef1c94
Fix bug where move from const symbol collections
NathanJPhillips cdbac8c
Sort output of symbol_tablet::show
NathanJPhillips 7aa80ad
Remove lookup_impl - it won't work for recording symbol table and add…
NathanJPhillips a2b45e3
Update to journalling symbol table
NathanJPhillips 3e42a8d
Add comment on has_symbol
NathanJPhillips 69d1a52
Added usages of base class symbol table
NathanJPhillips File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Author: Daniel Kroening, [email protected] | |
#include <util/cprover_prefix.h> | ||
#include <util/c_types.h> | ||
|
||
void java_internal_additions(symbol_tablet &dest) | ||
void java_internal_additions(symbol_table_baset &dest) | ||
{ | ||
// add __CPROVER_rounding_mode | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ Author: Daniel Kroening, [email protected] | |
#ifndef CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H | ||
#define CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H | ||
|
||
#include <util/symbol_table.h> | ||
#include <util/symbol_table_base.h> | ||
|
||
void java_internal_additions(symbol_tablet &dest); | ||
void java_internal_additions(symbol_table_baset &dest); | ||
|
||
#endif // CPROVER_JAVA_BYTECODE_JAVA_BYTECODE_INTERNAL_ADDITIONS_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ Author: Daniel Kroening, [email protected] | |
#include "java_types.h" | ||
#include "java_utils.h" | ||
|
||
static void create_initialize(symbol_tablet &symbol_table) | ||
static void create_initialize(symbol_table_baset &symbol_table) | ||
{ | ||
// If __CPROVER_initialize already exists, replace it. It may already exist | ||
// 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) | |
return non_null_globals.count(symbolid); | ||
} | ||
|
||
void java_static_lifetime_init( | ||
symbol_tablet &symbol_table, | ||
static void java_static_lifetime_init( | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &source_location, | ||
bool assume_init_pointers_not_null, | ||
const object_factory_parameterst &object_factory_parameters, | ||
|
@@ -162,7 +162,7 @@ void java_static_lifetime_init( | |
exprt::operandst java_build_arguments( | ||
const symbolt &function, | ||
code_blockt &init_code, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
bool assume_init_pointers_not_null, | ||
object_factory_parameterst object_factory_parameters, | ||
const select_pointer_typet &pointer_type_selector) | ||
|
@@ -246,7 +246,7 @@ void java_record_outputs( | |
const symbolt &function, | ||
const exprt::operandst &main_arguments, | ||
code_blockt &init_code, | ||
symbol_tablet &symbol_table) | ||
symbol_table_baset &symbol_table) | ||
{ | ||
const code_typet::parameterst ¶meters= | ||
to_code_type(function.type).parameters(); | ||
|
@@ -319,7 +319,7 @@ void java_record_outputs( | |
} | ||
|
||
main_function_resultt get_main_symbol( | ||
symbol_tablet &symbol_table, | ||
const symbol_table_baset &symbol_table, | ||
const irep_idt &main_class, | ||
message_handlert &message_handler, | ||
bool allow_no_body) | ||
|
@@ -445,7 +445,7 @@ main_function_resultt get_main_symbol( | |
/// | ||
/// \returns true if error occurred on entry point search | ||
bool java_entry_point( | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const irep_idt &main_class, | ||
message_handlert &message_handler, | ||
bool assume_init_pointers_not_null, | ||
|
@@ -500,7 +500,7 @@ bool java_entry_point( | |
/// \returns true if error occurred on entry point search, false otherwise | ||
bool generate_java_start_function( | ||
const symbolt &symbol, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
message_handlert &message_handler, | ||
bool assume_init_pointers_not_null, | ||
const object_factory_parameterst& object_factory_parameters, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected] | |
#define JAVA_ENTRY_POINT_EXCEPTION_SYMBOL "uncaught_exception'" | ||
|
||
bool java_entry_point( | ||
class symbol_tablet &symbol_table, | ||
class symbol_table_baset &symbol_table, | ||
const irep_idt &main_class, | ||
class message_handlert &message_handler, | ||
bool assume_init_pointers_not_null, | ||
|
@@ -61,14 +61,14 @@ struct main_function_resultt | |
|
||
/// Figures out the entry point of the code to verify | ||
main_function_resultt get_main_symbol( | ||
symbol_tablet &symbol_table, | ||
const symbol_table_baset &symbol_table, | ||
const irep_idt &main_class, | ||
message_handlert &, | ||
bool allow_no_body=false); | ||
bool allow_no_body = false); | ||
|
||
bool generate_java_start_function( | ||
const symbolt &symbol, | ||
class symbol_tablet &symbol_table, | ||
class symbol_table_baset &symbol_table, | ||
class message_handlert &message_handler, | ||
bool assume_init_pointers_not_null, | ||
const object_factory_parameterst& object_factory_parameters, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,10 @@ Author: Daniel Kroening, [email protected] | |
#include "java_root_class.h" | ||
|
||
static symbolt &new_tmp_symbol( | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
const typet &type, | ||
const std::string &prefix="tmp_object_factory") | ||
const std::string &prefix = "tmp_object_factory") | ||
{ | ||
return get_fresh_aux_symbol( | ||
type, | ||
|
@@ -69,7 +69,7 @@ class java_object_factoryt | |
std::unordered_set<irep_idt, irep_id_hash> recursion_set; | ||
|
||
/// The symbol table. | ||
symbol_tablet &symbol_table; | ||
symbol_table_baset &symbol_table; | ||
|
||
/// A namespace built from exclusively one symbol table - the one above. | ||
namespacet ns; | ||
|
@@ -102,9 +102,9 @@ class java_object_factoryt | |
std::vector<const symbolt *> &_symbols_created, | ||
const source_locationt &loc, | ||
const object_factory_parameterst _object_factory_parameters, | ||
symbol_tablet &_symbol_table, | ||
const select_pointer_typet &pointer_type_selector): | ||
symbols_created(_symbols_created), | ||
symbol_table_baset &_symbol_table, | ||
const select_pointer_typet &pointer_type_selector) | ||
: symbols_created(_symbols_created), | ||
loc(loc), | ||
object_factory_parameters(_object_factory_parameters), | ||
symbol_table(_symbol_table), | ||
|
@@ -182,7 +182,7 @@ class java_object_factoryt | |
exprt allocate_dynamic_object( | ||
const exprt &target_expr, | ||
const typet &allocate_type, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
code_blockt &output_code, | ||
std::vector<const symbolt *> &symbols_created, | ||
|
@@ -241,7 +241,7 @@ exprt allocate_dynamic_object( | |
/// \param output_code: code block to which the necessary code is added | ||
void allocate_dynamic_object_with_decl( | ||
const exprt &target_expr, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
code_blockt &output_code) | ||
{ | ||
|
@@ -543,7 +543,7 @@ codet initialize_nondet_string_struct( | |
const exprt &obj, | ||
const std::size_t &max_nondet_string_length, | ||
const source_locationt &loc, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
bool printable) | ||
{ | ||
PRECONDITION( | ||
|
@@ -636,7 +636,7 @@ static bool add_nondet_string_pointer_initialization( | |
const exprt &expr, | ||
const std::size_t &max_nondet_string_length, | ||
bool printable, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
code_blockt &code) | ||
{ | ||
|
@@ -1361,7 +1361,7 @@ exprt object_factory( | |
const irep_idt base_name, | ||
code_blockt &init_code, | ||
bool allow_null, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const object_factory_parameterst ¶meters, | ||
allocation_typet alloc_type, | ||
const source_locationt &loc, | ||
|
@@ -1457,7 +1457,7 @@ exprt object_factory( | |
void gen_nondet_init( | ||
const exprt &expr, | ||
code_blockt &init_code, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
bool skip_classid, | ||
allocation_typet alloc_type, | ||
|
@@ -1521,7 +1521,7 @@ exprt object_factory( | |
void gen_nondet_init( | ||
const exprt &expr, | ||
code_blockt &init_code, | ||
symbol_tablet &symbol_table, | ||
symbol_table_baset &symbol_table, | ||
const source_locationt &loc, | ||
bool skip_classid, | ||
allocation_typet alloc_type, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you generalise to the base class here, but not in the other methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Daniel's instructions: minimise churn by only messing with those functions we have a use for at the moment. Since we're only observing symbol table changes callable from
::typecheck
andlanguaget::final
, the result is some methods continuing to take asymbol_tablet
. The first user, if one ever comes along, can take responsibility for generalising them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, this PR should at least work with current TG. I'll list the necessary extensions below.