@@ -638,6 +638,7 @@ class type : public memento
638638 virtual struct_ *dyn_cast_struct () { return NULL ; }
639639 virtual vector_type *dyn_cast_vector_type () { return NULL ; }
640640 virtual array_type *dyn_cast_array_type () { return NULL ; }
641+ virtual compound_type *dyn_cast_compound_type () { return NULL ; }
641642 virtual memento_of_get_aligned *dyn_cast_aligned_type () { return NULL ; }
642643
643644 /* Is it typesafe to copy to this type from rtype? */
@@ -838,6 +839,7 @@ class decorated_type : public type
838839 type *is_pointer () final override { return m_other_type->is_pointer (); }
839840 type *is_array () final override { return m_other_type->is_array (); }
840841 struct_ *is_struct () final override { return m_other_type->is_struct (); }
842+ bool is_union () const final override { return m_other_type->is_union (); }
841843 bool is_signed () const final override { return m_other_type->is_signed (); }
842844
843845protected:
@@ -986,6 +988,10 @@ class memento_of_get_aligned : public decorated_type
986988 return m_other_type->dyn_cast_array_type ();
987989 }
988990
991+ compound_type *dyn_cast_compound_type () final override {
992+ return m_other_type->dyn_cast_compound_type ();
993+ }
994+
989995 vector_type *dyn_cast_vector_type () final override {
990996 return m_other_type->dyn_cast_vector_type ();
991997 }
@@ -1256,6 +1262,8 @@ class compound_type : public type
12561262 type *is_array () final override { return NULL ; }
12571263 bool is_signed () const final override { return false ; }
12581264
1265+ compound_type *dyn_cast_compound_type () final override { return this ; }
1266+
12591267 bool has_known_size () const final override { return m_fields != NULL ; }
12601268 void set_loc (location * loc) { m_loc = loc; }
12611269
0 commit comments