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