diff --git a/src/util/std_expr.cpp b/src/util/std_expr.cpp index 88608f650b7..ac7139113df 100644 --- a/src/util/std_expr.cpp +++ b/src/util/std_expr.cpp @@ -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; +} diff --git a/src/util/std_expr.h b/src/util/std_expr.h index 97861252881..b1cf4bacb57 100644 --- a/src/util/std_expr.h +++ b/src/util/std_expr.h @@ -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() {