File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1270,7 +1270,8 @@ void c_typecheck_baset::typecheck_c_enum_type(typet &type)
1270
1270
// we also track min and max to find a nice base type
1271
1271
mp_integer value=0 , min_value=0 , max_value=0 ;
1272
1272
1273
- std::list<c_enum_typet::c_enum_membert> enum_members;
1273
+ std::vector<c_enum_typet::c_enum_membert> enum_members;
1274
+ enum_members.reserve (as_expr.operands ().size ());
1274
1275
1275
1276
// We need to determine a width, and a signedness
1276
1277
// to obtain an 'underlying type'.
@@ -1413,14 +1414,11 @@ void c_typecheck_baset::typecheck_c_enum_type(typet &type)
1413
1414
enum_tag_symbol.is_file_local =true ;
1414
1415
enum_tag_symbol.base_name =base_name;
1415
1416
1416
- // throw in the enum members as 'body'
1417
- irept::subt &body=enum_tag_symbol.type .add (ID_body).get_sub ();
1418
-
1419
- for (const auto &member : enum_members)
1420
- body.push_back (member);
1421
-
1422
1417
enum_tag_symbol.type .add_subtype () = underlying_type;
1423
1418
1419
+ // throw in the enum members as 'body'
1420
+ to_c_enum_type (enum_tag_symbol.type ).members () = std::move (enum_members);
1421
+
1424
1422
// is it in the symbol table already?
1425
1423
symbolt *existing_symbol = symbol_table.get_writeable (identifier);
1426
1424
You can’t perform that action at this time.
0 commit comments