@@ -69,10 +69,10 @@ class struct_union_typet:public typet
69
69
public:
70
70
componentt () = default ;
71
71
72
- componentt (const irep_idt &_name, const typet & _type)
72
+ componentt (const irep_idt &_name, typet _type)
73
73
{
74
74
set_name (_name);
75
- type ()= _type;
75
+ type (). swap ( _type) ;
76
76
}
77
77
78
78
const irep_idt &get_name () const
@@ -148,8 +148,7 @@ class struct_union_typet:public typet
148
148
149
149
typedef std::vector<componentt> componentst;
150
150
151
- struct_union_typet (const irep_idt &_id, componentst &&_components)
152
- : typet(_id)
151
+ struct_union_typet (const irep_idt &_id, componentst _components) : typet(_id)
153
152
{
154
153
components () = std::move (_components);
155
154
}
@@ -244,7 +243,7 @@ class struct_typet:public struct_union_typet
244
243
{
245
244
}
246
245
247
- explicit struct_typet (componentst && _components)
246
+ explicit struct_typet (componentst _components)
248
247
: struct_union_typet(ID_struct, std::move(_components))
249
248
{
250
249
}
@@ -263,7 +262,7 @@ class struct_typet:public struct_union_typet
263
262
public:
264
263
struct_tag_typet &type ();
265
264
const struct_tag_typet &type () const ;
266
- explicit baset (const struct_tag_typet & base);
265
+ explicit baset (struct_tag_typet base);
267
266
};
268
267
269
268
typedef std::vector<baset> basest;
@@ -398,7 +397,7 @@ class union_typet:public struct_union_typet
398
397
{
399
398
}
400
399
401
- explicit union_typet (componentst && _components)
400
+ explicit union_typet (componentst _components)
402
401
: struct_union_typet(ID_union, std::move(_components))
403
402
{
404
403
}
@@ -621,8 +620,8 @@ inline enumeration_typet &to_enumeration_type(typet &type)
621
620
class c_enum_typet :public type_with_subtypet
622
621
{
623
622
public:
624
- explicit c_enum_typet (const typet & _subtype):
625
- type_with_subtypet(ID_c_enum, _subtype)
623
+ explicit c_enum_typet (typet _subtype)
624
+ : type_with_subtypet(ID_c_enum, std::move( _subtype) )
626
625
{
627
626
}
628
627
@@ -743,22 +742,12 @@ class code_typet:public typet
743
742
// / Constructs a new code type, i.e., function type.
744
743
// / \param _parameters: The vector of function parameters.
745
744
// / \param _return_type: The return type.
746
- code_typet (parameterst && _parameters, typet && _return_type) : typet(ID_code)
745
+ code_typet (parameterst _parameters, typet _return_type) : typet(ID_code)
747
746
{
748
747
parameters ().swap (_parameters);
749
748
return_type ().swap (_return_type);
750
749
}
751
750
752
- // / Constructs a new code type, i.e., function type.
753
- // / \param _parameters: The vector of function parameters.
754
- // / \param _return_type: The return type.
755
- code_typet (parameterst &&_parameters, const typet &_return_type)
756
- : typet(ID_code)
757
- {
758
- parameters ().swap (_parameters);
759
- return_type () = _return_type;
760
- }
761
-
762
751
// / \deprecated
763
752
DEPRECATED (" Use the two argument constructor instead" )
764
753
code_typet ():typet(ID_code)
@@ -986,11 +975,10 @@ inline code_typet &to_code_type(typet &type)
986
975
class array_typet :public type_with_subtypet
987
976
{
988
977
public:
989
- array_typet (
990
- const typet &_subtype,
991
- const exprt &_size):type_with_subtypet(ID_array, _subtype)
978
+ array_typet (typet _subtype, exprt _size)
979
+ : type_with_subtypet(ID_array, std::move(_subtype))
992
980
{
993
- size ()= _size;
981
+ add (ID_size, std::move ( _size)) ;
994
982
}
995
983
996
984
const exprt &size () const
@@ -1458,10 +1446,10 @@ inline floatbv_typet &to_floatbv_type(typet &type)
1458
1446
class c_bit_field_typet :public bitvector_typet
1459
1447
{
1460
1448
public:
1461
- explicit c_bit_field_typet (const typet & _subtype, std::size_t width)
1449
+ explicit c_bit_field_typet (typet _subtype, std::size_t width)
1462
1450
: bitvector_typet(ID_c_bit_field, width)
1463
1451
{
1464
- subtype () = _subtype;
1452
+ subtype (). swap ( _subtype) ;
1465
1453
}
1466
1454
1467
1455
// These have a sub-type
@@ -1503,10 +1491,10 @@ inline c_bit_field_typet &to_c_bit_field_type(typet &type)
1503
1491
class pointer_typet :public bitvector_typet
1504
1492
{
1505
1493
public:
1506
- pointer_typet (const typet & _subtype, std::size_t width)
1494
+ pointer_typet (typet _subtype, std::size_t width)
1507
1495
: bitvector_typet(ID_pointer, width)
1508
1496
{
1509
- subtype () = _subtype;
1497
+ subtype (). swap ( _subtype) ;
1510
1498
}
1511
1499
1512
1500
signedbv_typet difference_type () const
@@ -1561,8 +1549,8 @@ inline pointer_typet &to_pointer_type(typet &type)
1561
1549
class reference_typet :public pointer_typet
1562
1550
{
1563
1551
public:
1564
- reference_typet (const typet & _subtype, std::size_t _width):
1565
- pointer_typet (_subtype, _width)
1552
+ reference_typet (typet _subtype, std::size_t _width)
1553
+ : pointer_typet(std::move( _subtype) , _width)
1566
1554
{
1567
1555
set (ID_C_reference, true );
1568
1556
}
@@ -1798,8 +1786,8 @@ class complex_typet:public type_with_subtypet
1798
1786
{
1799
1787
}
1800
1788
1801
- explicit complex_typet (const typet & _subtype):
1802
- type_with_subtypet(ID_complex, _subtype)
1789
+ explicit complex_typet (typet _subtype)
1790
+ : type_with_subtypet(ID_complex, std::move( _subtype) )
1803
1791
{
1804
1792
}
1805
1793
};
0 commit comments