Skip to content

move object_descriptor_exprt::root_object into .cpp #2833

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 1 commit into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/util/std_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,16 @@ struct_exprt::component(const irep_idt &name, const namespacet &ns) const
{
return ::component(*this, name, ns);
}

const exprt &object_descriptor_exprt::root_object() const
{
const exprt *p = &object();

while(p->id() == ID_member || p->id() == ID_index)
{
assert(!p->operands().empty());
p = &p->op0();
}

return *p;
}
13 changes: 1 addition & 12 deletions src/util/std_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1966,18 +1966,7 @@ class object_descriptor_exprt:public binary_exprt
return op0();
}

const exprt &root_object() const
{
const exprt *p=&object();

while(p->id()==ID_member || p->id()==ID_index)
{
assert(!p->operands().empty());
p=&p->op0();
}

return *p;
}
const exprt &root_object() const;

exprt &offset()
{
Expand Down