File tree 2 files changed +24
-18
lines changed 2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -283,3 +283,19 @@ bool is_constant_or_has_constant_components(
283
283
284
284
return false ;
285
285
}
286
+
287
+ vector_typet::vector_typet (const typet &_subtype, const constant_exprt &_size)
288
+ : type_with_subtypet(ID_vector, _subtype)
289
+ {
290
+ size () = _size;
291
+ }
292
+
293
+ const constant_exprt &vector_typet::size () const
294
+ {
295
+ return static_cast <const constant_exprt &>(find (ID_size));
296
+ }
297
+
298
+ constant_exprt &vector_typet::size ()
299
+ {
300
+ return static_cast <constant_exprt &>(add (ID_size));
301
+ }
Original file line number Diff line number Diff line change @@ -1751,28 +1751,18 @@ inline range_typet &to_range_type(typet &type)
1751
1751
// / Used to represent the short vectors used by CPU instruction sets such as
1752
1752
// / MMX, SSE and AVX. They all provide registers that are something like
1753
1753
// / 8 x int32, for example, and corresponding operations that operate
1754
- // / element-wise on their operand vectors. Compared to \ref array_typet
1755
- // / that has no element-wise operators. Note that `remove_vector.h` removes
1756
- // / this data type by compilation into arrays.
1754
+ // / element-wise on their operand vectors. Compared to \ref array_typet,
1755
+ // / vector_typet has a fixed size whereas array_typet has no element-wise
1756
+ // / operators.
1757
+ // / Note that `remove_vector.h` removes this data type by compilation into
1758
+ // / arrays.
1757
1759
class vector_typet :public type_with_subtypet
1758
1760
{
1759
1761
public:
1760
- vector_typet (
1761
- const typet &_subtype,
1762
- const exprt &_size):type_with_subtypet(ID_vector, _subtype)
1763
- {
1764
- size ()=_size;
1765
- }
1762
+ vector_typet (const typet &_subtype, const constant_exprt &_size);
1766
1763
1767
- const exprt &size () const
1768
- {
1769
- return static_cast <const exprt &>(find (ID_size));
1770
- }
1771
-
1772
- exprt &size ()
1773
- {
1774
- return static_cast <exprt &>(add (ID_size));
1775
- }
1764
+ const constant_exprt &size () const ;
1765
+ constant_exprt &size ();
1776
1766
};
1777
1767
1778
1768
// / Check whether a reference to a typet is a \ref vector_typet.
You can’t perform that action at this time.
0 commit comments