-
Notifications
You must be signed in to change notification settings - Fork 274
added code_blockt::statements(), which is a vector of codet #3080
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,8 @@ static bool insert_at_label( | |
const irep_idt &label, | ||
code_blockt &dest) | ||
{ | ||
Forall_operands(it, dest) | ||
for(auto &c : dest.statements()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does |
||
{ | ||
codet &c=to_code(*it); | ||
|
||
if(c.get_statement()!=ID_label) | ||
continue; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,9 +105,21 @@ class code_blockt:public codet | |
{ | ||
} | ||
|
||
typedef std::vector<codet> code_operandst; | ||
|
||
code_operandst &statements() | ||
{ | ||
return (code_operandst &)get_sub(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesn't work, the C++ type system isn't that elaborate. |
||
} | ||
|
||
const code_operandst &statements() const | ||
{ | ||
return (const code_operandst &)get_sub(); | ||
} | ||
|
||
explicit code_blockt(const std::list<codet> &_list):codet(ID_block) | ||
{ | ||
operandst &o=operands(); | ||
auto &o = statements(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
reserve_operands(_list.size()); | ||
for(std::list<codet>::const_iterator | ||
it=_list.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.
Nit pick: please add braces for readability
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.
ok