-
Notifications
You must be signed in to change notification settings - Fork 274
Use irept instead of symbol_exprt in java_lambda_method_handlest [blocks: #2310] #3286
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
Use irept instead of symbol_exprt in java_lambda_method_handlest [blocks: #2310] #3286
Conversation
6a6ca5a
to
6d99326
Compare
6d99326
to
75b935c
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 6d99326).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90526786
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
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: 75b935c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90530732
75b935c
to
193bb15
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 193bb15).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90579104
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
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.
On the face of it seems reasonable - but some thought went in to this so would like the time to properly consider and check with TG as I don't recall why we opted for symbol_exprt
here
@thk123 +1 for careful evaluation with TG, please do re-assign as appropriate. |
193bb15
to
592db89
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.
Diffblue compatibility check is currently unavailable.
Please create manual bump.
(cbmc commit: 592db89).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90843000
592db89
to
2e2a8a3
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.
So this is fine - I think we will revisit this - this is as far as lambdas get at the moment (i.e. they still don't work) - it might be it makes sense to put a bespoke
class lambda_method_handlet : public irept
{
irep_idt lambda_identifier() const;
code_tyept lambda_type() const;
// lambda type?
}
but lets wait until we know what we need rather than second guessing it.
The only thing I might suggest now is typedef lamdba_method_handle_identifiert
as an irept
so more obvious that it isn't a tree of stuff, just a name. In fact, would:
class lambda_method_handle_identifiert : private irept
{
public:
explicit lambda_method_handle_identifiert(const irep_idt &identifier) : irept(identifier)
lambda_identifier() const { return id(); }
}
be a good immediate solution? (i.e. using private inheritance to essentially make this behave like an irep_idt
)
Anyway - it's fine as it is until we know what we do with the data next.
I made a manual bump but I don't expect it to break anything (and indeed Joel-bot linked to a passing build) https://github.com/diffblue/test-gen/pull/2458 |
Why would you suggest private inheritance here? I think the one with public inheritance would work fine, though. Just not entirely sure whether it's worth the effort if you are about to rewrite some of this anyway? |
Well "about to" is probably pushing it! Happy for it to go in as is 🙂 I'm not sure about private inheritance - there is nothing specific to this case that means it should be used over any other irep-inheriting class, but I think it might be a good idea: AFAICT it would forbid direct irep manipulation (a major source of bugs/refactoring pain when people just add random sub trees and extra data inconsistently) to make them behave more like properly typed C++ classes, but wouldn't have any performance impact or require any major restructuring (only need to remove direct irep access - but these probably should be removed anyway). |
TG bump has passed |
2e2a8a3
to
49d4914
Compare
@thk123 I've gone the coward's route and only included your suggestion as a comment rather than changing the code at this point. I hope that's ok? |
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 49d4914).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90890870
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
A java_lambda_method_handlest really is just a collection of identifiers - there is no need to put them into a symbol_exprt, instead the identifier can directly be used as the id of an irept. This reduces the memory footprint, but more importantly avoids a warning of using a deprecated symbol_exprt constructor. This warning is well placed, because those symbol_exprt would never have a type set, which makes them invalid symbol_exprt anyway.
49d4914
to
68d7791
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: 68d7791).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90938940
A java_lambda_method_handlest really is just a collection of identifiers - there
is no need to put them into a symbol_exprt, instead the identifier can directly
be used as the id of an irept. This reduces the memory footprint, but more
importantly avoids a warning of using a deprecated symbol_exprt constructor.
This warning is well placed, because those symbol_exprt would never have a type
set, which makes them invalid symbol_exprt anyway.