-
Notifications
You must be signed in to change notification settings - Fork 274
Share a common class_hierarchyt instance across multiple users #3216
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
smowton
merged 7 commits into
diffblue:develop
from
smowton:smowton/feature/shared-class-hierarchy
Oct 24, 2018
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
be44674
Add missing doc-string for a remove_exceptions overload
smowton 253e331
Fix missing newline at end of file
smowton 22638e2
Make jdiff log message match janalyzer
smowton e39721f
Add whitespace between unrelated pass invocations
smowton eb5df0a
Add one-shot constructor to class_hierarchyt
smowton df455b8
Avoid recomputing class hierarchy
smowton 5e9aba8
Remove unnecessary newline
smowton 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
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 |
---|---|---|
|
@@ -79,6 +79,7 @@ Author: Chris Smowton, [email protected] | |
#ifndef CPROVER_JAVA_BYTECODE_REMOVE_INSTANCEOF_H | ||
#define CPROVER_JAVA_BYTECODE_REMOVE_INSTANCEOF_H | ||
|
||
#include <goto-programs/class_hierarchy.h> | ||
#include <goto-programs/goto_functions.h> | ||
#include <goto-programs/goto_model.h> | ||
|
||
|
@@ -89,18 +90,24 @@ void remove_instanceof( | |
goto_programt::targett target, | ||
goto_programt &goto_program, | ||
symbol_table_baset &symbol_table, | ||
const class_hierarchyt &class_hierarchy, | ||
message_handlert &); | ||
|
||
void remove_instanceof( | ||
goto_functionst::goto_functiont &function, | ||
symbol_table_baset &symbol_table, | ||
const class_hierarchyt &class_hierarchy, | ||
message_handlert &); | ||
|
||
void remove_instanceof( | ||
goto_functionst &goto_functions, | ||
symbol_table_baset &symbol_table, | ||
const class_hierarchyt &class_hierarchy, | ||
message_handlert &); | ||
|
||
void remove_instanceof(goto_modelt &model, message_handlert &); | ||
void remove_instanceof( | ||
goto_modelt &model, | ||
const class_hierarchyt &class_hierarchy, | ||
message_handlert &); | ||
|
||
#endif |
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 |
---|---|---|
|
@@ -552,6 +552,9 @@ int jbmc_parse_optionst::doit() | |
*this, options, get_message_handler()); | ||
lazy_goto_model.initialize(cmdline, options); | ||
|
||
class_hierarchy = | ||
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed here? |
||
|
||
// The precise wording of this error matches goto-symex's complaint when no | ||
// __CPROVER_start exists (if we just go ahead and run it anyway it will | ||
// trip an invariant when it tries to load it) | ||
|
@@ -629,12 +632,13 @@ int jbmc_parse_optionst::get_goto_program( | |
*this, options, get_message_handler()); | ||
lazy_goto_model.initialize(cmdline, options); | ||
|
||
class_hierarchy = | ||
util_make_unique<class_hierarchyt>(lazy_goto_model.symbol_table); | ||
|
||
// Show the class hierarchy | ||
if(cmdline.isset("show-class-hierarchy")) | ||
{ | ||
class_hierarchyt hierarchy; | ||
hierarchy(lazy_goto_model.symbol_table); | ||
show_class_hierarchy(hierarchy, ui_message_handler); | ||
show_class_hierarchy(*class_hierarchy, ui_message_handler); | ||
return CPROVER_EXIT_SUCCESS; | ||
} | ||
|
||
|
@@ -729,7 +733,8 @@ void jbmc_parse_optionst::process_goto_function( | |
try | ||
{ | ||
// Removal of RTTI inspection: | ||
remove_instanceof(goto_function, symbol_table, get_message_handler()); | ||
remove_instanceof( | ||
goto_function, symbol_table, *class_hierarchy, get_message_handler()); | ||
// Java virtual functions -> explicit dispatch tables: | ||
remove_virtual_functions(function); | ||
|
||
|
@@ -743,6 +748,7 @@ void jbmc_parse_optionst::process_goto_function( | |
remove_exceptions( | ||
goto_function.body, | ||
symbol_table, | ||
class_hierarchy.get(), | ||
get_message_handler(), | ||
remove_exceptions_typest::REMOVE_ADDED_INSTANCEOF); | ||
} | ||
|
@@ -888,6 +894,7 @@ bool jbmc_parse_optionst::process_goto_functions( | |
// (introduces instanceof but request it is removed) | ||
remove_exceptions( | ||
goto_model, | ||
class_hierarchy.get(), | ||
get_message_handler(), | ||
remove_exceptions_typest::REMOVE_ADDED_INSTANCEOF); | ||
|
||
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.