-
Notifications
You must be signed in to change notification settings - Fork 274
use code_blockt::statements() where appropriate #2830
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
Conversation
62eafff
to
3dd0a63
Compare
I'll clang-format once reviewed; it's easier to review without. |
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 would I suppose be a good time to apply this change in TG as well - how urgently do you want to get this in? It still needs a bump and I'd rather not see the introduction of synonym methods (labelled ❓ )
src/util/std_code.h
Outdated
@@ -118,12 +118,12 @@ class code_blockt:public codet | |||
|
|||
void move(codet &code) | |||
{ | |||
move_to_operands(code); | |||
exprt::move_to_operands(code); |
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.
What's the reason for this change?
src/util/std_code.h
Outdated
@@ -101,21 +101,39 @@ inline codet &to_code(exprt &expr) | |||
class code_blockt:public codet | |||
{ | |||
public: | |||
typedef std::vector<codet> code_operandst; | |||
|
|||
code_operandst &code_operands() |
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.
❓ What's the purpose of having both code_operands()
and statements()
?
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.
The idea is to eventually have code_operands() in codet, once codet stops inheriting from exprt.
No genuine urgency to do this on TG. |
3dd0a63
to
658c93f
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: 658c93f).
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).
@@ -787,16 +787,16 @@ code_blockt &java_bytecode_convert_methodt::get_or_create_block_for_pcrange( | |||
return this_block; | |||
|
|||
// Find the child code_blockt where the queried range begins: | |||
auto child_iter=this_block.operands().begin(); | |||
auto child_iter=this_block.statements().begin(); |
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.
Throughout this commit: please weave in clang-format style spacing while touching the various lines.
++child_iter; | ||
assert(child_iter!=this_block.operands().end()); | ||
assert(child_iter!=this_block.statements().end()); |
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.
Should be a DATA_INVARIANT
std::advance(child_iter, child_offset); | ||
assert(child_iter!=this_block.operands().end()); | ||
auto &child_label=to_code_label(to_code(*child_iter)); | ||
assert(child_iter!=this_block.statements().end()); |
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 assert
actually never was good enough as far as I can tell: the iterator should have been advanced well beyond the end()
iterator.
658c93f
to
b8d45ef
Compare
2311e72
to
361bba3
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: 361bba3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87625389
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.
361bba3
to
7813fec
Compare
static bool move_label_ifthenelse( | ||
exprt &expr, | ||
exprt &label_dest) | ||
static bool move_label_ifthenelse(exprt &expr, exprt &label_dest) |
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.
Unrelated changes?
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.
That was clang-format.
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: 7813fec).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87882190
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.
goto-instrument changes look fine.
7813fec
to
ec1b59a
Compare
ec1b59a
to
5dceb25
Compare
This avoids a runtime check that the operand is codet.
5dceb25
to
01fd831
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: ec1b59a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88419397
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.
This PR failed Diffblue compatibility checks (cbmc commit: 5dceb25).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88420660
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: 01fd831).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88424313
add/move are type-safe; copy_to_operands and move_to_operands are not.