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