@@ -271,6 +271,8 @@ inline struct_union_typet &to_struct_union_type(typet &type)
271
271
return static_cast <struct_union_typet &>(type);
272
272
}
273
273
274
+ class struct_tag_typet ;
275
+
274
276
// / Structure type, corresponds to C style structs
275
277
class struct_typet :public struct_union_typet
276
278
{
@@ -291,19 +293,9 @@ class struct_typet:public struct_union_typet
291
293
class baset : public exprt
292
294
{
293
295
public:
294
- symbol_typet &type ()
295
- {
296
- return to_symbol_type (exprt::type ());
297
- }
298
-
299
- const symbol_typet &type () const
300
- {
301
- return to_symbol_type (exprt::type ());
302
- }
303
-
304
- explicit baset (const symbol_typet &base) : exprt(ID_base, base)
305
- {
306
- }
296
+ struct_tag_typet &type ();
297
+ const struct_tag_typet &type () const ;
298
+ explicit baset (const struct_tag_typet &base);
307
299
};
308
300
309
301
typedef std::vector<baset> basest;
@@ -322,23 +314,12 @@ class struct_typet:public struct_union_typet
322
314
323
315
// / Add a base class/struct
324
316
// / \param base: Type of case/class struct to be added.
325
- void add_base (const symbol_typet &base)
326
- {
327
- bases ().push_back (baset (base));
328
- }
317
+ void add_base (const struct_tag_typet &base);
329
318
330
319
// / Return the base with the given name, if exists.
331
320
// / \param id The name of the base we are looking for.
332
321
// / \return The base if exists.
333
- optionalt<baset> get_base (const irep_idt &id) const
334
- {
335
- for (const auto &b : bases ())
336
- {
337
- if (to_symbol_type (b.type ()).get_identifier () == id)
338
- return b;
339
- }
340
- return {};
341
- }
322
+ optionalt<baset> get_base (const irep_idt &id) const ;
342
323
343
324
// / Test whether `id` is a base class/struct.
344
325
// / \param id: symbol type name
0 commit comments