-
Notifications
You must be signed in to change notification settings - Fork 275
Templatize value-set analysis #1499
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
tautschnig
merged 4 commits into
diffblue:develop
from
smowton:smowton/feature/vsa_take_two
Nov 26, 2017
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ Author: Daniel Kroening, [email protected] | |
#ifndef CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H | ||
#define CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H | ||
|
||
#include <pointer-analysis/value_set_analysis.h> | ||
#include <util/ui_message.h> | ||
|
||
class goto_modelt; | ||
class value_set_analysist; | ||
|
||
void show_value_sets( | ||
ui_message_handlert::uit, | ||
|
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 |
---|---|---|
|
@@ -33,6 +33,9 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "add_failed_symbols.h" | ||
|
||
// Due to a large number of functions defined inline, `value_sett` and | ||
// associated types are documented in its header file, `value_set.h`. | ||
|
||
const value_sett::object_map_dt value_sett::object_map_dt::blank{}; | ||
object_numberingt value_sett::object_numbering; | ||
|
||
|
@@ -1205,6 +1208,12 @@ void value_sett::assign( | |
object_mapt values_rhs; | ||
get_value_set(rhs, values_rhs, ns, is_simplified); | ||
|
||
// Permit custom subclass to alter the read values prior to write: | ||
adjust_assign_rhs_values(rhs, ns, values_rhs); | ||
|
||
// Permit custom subclass to perform global side-effects prior to write: | ||
apply_assign_side_effects(lhs, rhs, ns); | ||
|
||
assign_rec(lhs, values_rhs, "", ns, add_to_sets); | ||
} | ||
} | ||
|
@@ -1484,7 +1493,7 @@ void value_sett::do_end_function( | |
assign(lhs, rhs, ns, false, false); | ||
} | ||
|
||
void value_sett::apply_code( | ||
void value_sett::apply_code_rec( | ||
const codet &code, | ||
const namespacet &ns) | ||
{ | ||
|
@@ -1493,7 +1502,7 @@ void value_sett::apply_code( | |
if(statement==ID_block) | ||
{ | ||
forall_operands(it, code) | ||
apply_code(to_code(*it), ns); | ||
apply_code_rec(to_code(*it), ns); | ||
} | ||
else if(statement==ID_function_call) | ||
{ | ||
|
@@ -1611,6 +1620,10 @@ void value_sett::apply_code( | |
{ | ||
// doesn't do anything | ||
} | ||
else if(statement==ID_dead) | ||
{ | ||
// Ignore by default; could prune the value set. | ||
} | ||
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. This is an unrelated change that would warrant a dedicated commit I'd say. |
||
else | ||
{ | ||
// std::cerr << code.pretty() << '\n'; | ||
|
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.
As much as I agree this is a slightly better name: is the renaming essential?
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.
The case for this was: it's better to rename this and override the private function than to override the public
apply_code
, thus separating the customisation point (apply_code_rec
) from the public interface (apply_code
).