Skip to content

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

Merged
merged 2 commits into from
Jan 24, 2019

Conversation

thk123
Copy link
Contributor

@thk123 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.

@thk123
Copy link
Contributor Author

thk123 commented Jan 23, 2019

Was looking at this to do the refactor of java_bytecode_convert_method, but the resolve_inherited_componentt relies on the globals already being present in the symbol table so isn't trivially applicable here, instead I will perform the tidy up requested.

@thk123 thk123 added the cleanup label Jan 23, 2019
Copy link
Contributor

@allredj allredj left a 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

Copy link
Collaborator

@tautschnig tautschnig left a 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 :-)

Copy link
Contributor

@smowton smowton left a 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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a reference (0394j4)

Copy link
Contributor Author

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(
Copy link
Contributor

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(
Copy link
Contributor

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);
Copy link
Contributor

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 =
Copy link
Contributor

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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(0394j4)

@smowton
Copy link
Contributor

smowton commented Jan 23, 2019

^ (0394j4) is like your emoji thing except I don't know how to type emoji :)

@thk123
Copy link
Contributor Author

thk123 commented Jan 23, 2019

@smowton For future reference, type a : and then the name of the emoji 😛

@thk123 thk123 force-pushed the clean-resolve-inherited-component branch from 5e74f0a to 9c31349 Compare January 23, 2019 17:41
@thk123
Copy link
Contributor Author

thk123 commented Jan 23, 2019

@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);
Copy link
Member

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

Copy link
Contributor

@allredj allredj left a 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

@thk123 thk123 force-pushed the clean-resolve-inherited-component branch from 9c31349 to 5bc48f8 Compare January 24, 2019 09:20
Copy link
Contributor

@allredj allredj left a 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

@thk123 thk123 merged commit fd3d187 into diffblue:develop Jan 24, 2019
@thk123 thk123 deleted the clean-resolve-inherited-component branch January 24, 2019 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants