Make renamedt inherit from underlyingt#4454
Merged
tautschnig merged 1 commit intodiffblue:developfrom Mar 29, 2019
Merged
Conversation
This is so that we can easily convert from an exprt to a renamedt using
static_cast.
The potential use case, is to be able to look at all the operands of a
renamedt, as renamedt themselves without having to construct new
objects.
For instance assuming `f` takes `renamedt` as argument, we could declare
a renamedt method:
```
void renamedt::apply_to_operands()
{
for(exprt &op : operands())
f(static_cast<renamedt&>(op));
}
```
7 tasks
Contributor
|
Counter-proposal: smowton@1daa2c6 Already suggested that to @owen-jones-diffblue |
73e77cf to
aa3f0f1
Compare
allredj
reviewed
Mar 29, 2019
Contributor
allredj
left a comment
There was a problem hiding this comment.
This PR failed Diffblue compatibility checks (cbmc commit: aa3f0f1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106290116
Status will be re-evaluated on next push.
Common spurious failures include: 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); compatibility was already broken by an earlier merge.
smowton
approved these changes
Mar 29, 2019
owen-mc-diffblue
approved these changes
Mar 29, 2019
Contributor
owen-mc-diffblue
left a comment
There was a problem hiding this comment.
I will rebase #4444 on this so we can avoid calling constructors all the time
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is so that we can easily convert from an exprt to a renamedt using
static_cast.
The potential use case, is to be able to look at all the operands of a
renamedt, as renamedt themselves without having to construct new
objects.
For instanc, we could declare a renamedt method:
The idea for correctness is that if an expression is renamed then all its operands also are, by construction.