@@ -646,6 +646,7 @@ class type : public memento
646646 virtual struct_ *dyn_cast_struct () { return NULL ; }
647647 virtual vector_type *dyn_cast_vector_type () { return NULL ; }
648648 virtual array_type *dyn_cast_array_type () { return NULL ; }
649+ virtual compound_type *dyn_cast_compound_type () { return NULL ; }
649650 virtual memento_of_get_aligned *dyn_cast_aligned_type () { return NULL ; }
650651
651652 /* Is it typesafe to copy to this type from rtype? */
@@ -846,6 +847,7 @@ class decorated_type : public type
846847 type *is_pointer () final override { return m_other_type->is_pointer (); }
847848 type *is_array () final override { return m_other_type->is_array (); }
848849 struct_ *is_struct () final override { return m_other_type->is_struct (); }
850+ bool is_union () const final override { return m_other_type->is_union (); }
849851 bool is_signed () const final override { return m_other_type->is_signed (); }
850852
851853protected:
@@ -994,6 +996,10 @@ class memento_of_get_aligned : public decorated_type
994996 return m_other_type->dyn_cast_array_type ();
995997 }
996998
999+ compound_type *dyn_cast_compound_type () final override {
1000+ return m_other_type->dyn_cast_compound_type ();
1001+ }
1002+
9971003 vector_type *dyn_cast_vector_type () final override {
9981004 return m_other_type->dyn_cast_vector_type ();
9991005 }
@@ -1264,6 +1270,8 @@ class compound_type : public type
12641270 type *is_array () final override { return NULL ; }
12651271 bool is_signed () const final override { return false ; }
12661272
1273+ compound_type *dyn_cast_compound_type () final override { return this ; }
1274+
12671275 bool has_known_size () const final override { return m_fields != NULL ; }
12681276 void set_loc (location * loc) { m_loc = loc; }
12691277
0 commit comments