-
Notifications
You must be signed in to change notification settings - Fork 273
Optimize remove_level_2 #3559
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
romainbrenguier
merged 6 commits into
diffblue:develop
from
romainbrenguier:optimize/get_l1_name
Dec 14, 2018
Merged
Optimize remove_level_2 #3559
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9157f0f
Move update_identifier definition to cpp file
romainbrenguier 5f9fd35
Remove build_identifier from the public_interface
romainbrenguier 8bd5402
Document build_ssa_identifier_rec
romainbrenguier 75f7c77
Hide get_l1_name from interface
romainbrenguier 7efc7b8
Inline get_l1_name
romainbrenguier 7114c57
Optimize remove_level_2
romainbrenguier 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <analyses/dirty.h> | ||
|
||
static void get_l1_name(exprt &expr); | ||
|
||
goto_symex_statet::goto_symex_statet() | ||
: depth(0), | ||
symex_target(nullptr), | ||
|
@@ -220,7 +222,7 @@ void goto_symex_statet::assignment( | |
get_l1_name(l1_rhs); | ||
|
||
ssa_exprt l1_lhs(lhs); | ||
get_l1_name(l1_lhs); | ||
l1_lhs.remove_level_2(); | ||
|
||
if(run_validation_checks) | ||
{ | ||
|
@@ -750,7 +752,7 @@ void goto_symex_statet::get_original_name(typet &type) const | |
} | ||
} | ||
|
||
void goto_symex_statet::get_l1_name(exprt &expr) const | ||
static void get_l1_name(exprt &expr) | ||
{ | ||
// do not reset the 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
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 |
---|---|---|
|
@@ -13,6 +13,10 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/arith_tools.h> | ||
|
||
/// If \p expr is a symbol "s" add to \p os "s!l0@l1#l2" and to \p l1_object_os | ||
/// "s!l0@l1". | ||
/// If \p expr is a member or index expression, recursively apply the procedure | ||
/// and add ".component_name" or "[index]" to \p os. | ||
static void build_ssa_identifier_rec( | ||
const exprt &expr, | ||
const irep_idt &l0, | ||
|
@@ -82,7 +86,7 @@ bool ssa_exprt::can_build_identifier(const exprt &expr) | |
return false; | ||
} | ||
|
||
std::pair<irep_idt, irep_idt> ssa_exprt::build_identifier( | ||
static std::pair<irep_idt, irep_idt> build_identifier( | ||
const exprt &expr, | ||
const irep_idt &l0, | ||
const irep_idt &l1, | ||
|
@@ -95,3 +99,14 @@ std::pair<irep_idt, irep_idt> ssa_exprt::build_identifier( | |
|
||
return std::make_pair(irep_idt(oss.str()), irep_idt(l1_object_oss.str())); | ||
} | ||
|
||
void ssa_exprt::update_identifier() | ||
{ | ||
const irep_idt &l0 = get_level_0(); | ||
const irep_idt &l1 = get_level_1(); | ||
const irep_idt &l2 = get_level_2(); | ||
|
||
auto idpair = build_identifier(get_original_expr(), l0, l1, l2); | ||
set_identifier(idpair.first); | ||
set(ID_L1_object_identifier, idpair.second); | ||
} |
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
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.
Commit message typo: "and probably shouldn't." -> "and probably shouldn't be part of it."