-
Notifications
You must be signed in to change notification settings - Fork 274
Clean resolve inherited component #3899
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
Clean resolve inherited component #3899
Conversation
thk123
commented
Jan 23, 2019
- Each commit message has a non-empty body, explaining why the change was made.
- [n/a] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- [n/a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
- [n/a] Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
- [n/a] My commit message includes data points confirming performance improvements (if claimed).
- My PR is restricted to a single feature or bugfix.
- White-space or formatting changes outside the feature-related changed lines are in commits of their own.
Was looking at this to do the refactor of java_bytecode_convert_method, but the |
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 5e74f0a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98344502
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.
I really like negative diff stats :-)
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.
Don't refer to optionalt
returned by value using a reference type -- this works due to automagical lifetime extension but gives the impression that it refers to something in-place when it's actually a local.
class_hierarchy, | ||
false); | ||
return inherited_method.is_valid(); | ||
const auto &inherited_method = get_inherited_component( |
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.
Not a reference (0394j4)
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.
Initially thought it was C++ spec reference, and was very impressed!
symbol_table, | ||
class_hierarchy, | ||
true); | ||
const auto &inherited_method = get_inherited_component( |
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.
(0394j4)
class_hierarchy, | ||
true); | ||
if(!referred_component.is_valid()) | ||
const auto &referred_component = get_inherited_component( |
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.
(0394j4)
const resolve_inherited_componentt::inherited_componentt | ||
&resolved_call = resolve_function_call(child, component_name); | ||
if(resolved_call.is_valid()) | ||
const auto &resolved_call = resolve_function_call(child, component_name); |
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.
(0394j4)
@@ -339,22 +340,22 @@ resolve_inherited_componentt::inherited_componentt get_inherited_component( | |||
{ | |||
resolve_inherited_componentt component_resolver( | |||
symbol_table, class_hierarchy); | |||
const resolve_inherited_componentt::inherited_componentt resolved_component = | |||
const auto &resolved_component = |
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.
(0394j4)
@@ -449,22 +447,22 @@ void remove_virtual_functionst::get_functions( | |||
return get_virtual_call_target(class_id, function_name, false); | |||
}; | |||
|
|||
const resolve_inherited_componentt::inherited_componentt | |||
&resolved_call = get_virtual_call_target(class_id, function_name, false); | |||
const auto &resolved_call = |
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.
(0394j4)
^ (0394j4) is like your emoji thing except I don't know how to type emoji :) |
@smowton For future reference, type a |
5e74f0a
to
9c31349
Compare
@smowton addressed. |
@@ -548,11 +548,10 @@ irep_idt ci_lazy_methodst::get_virtual_method_target( | |||
return irep_idt(); | |||
|
|||
resolve_inherited_componentt call_resolver(symbol_table, class_hierarchy); | |||
const resolve_inherited_componentt::inherited_componentt resolved_call = | |||
call_resolver(classname, call_basename, false); | |||
const auto &resolved_call = call_resolver(classname, call_basename, false); |
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.
🚫 Shouldn't be a reference
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 9c31349).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98361182
Provides more natural syntax.
9c31349
to
5bc48f8
Compare
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 5bc48f8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98445489