@@ -2953,82 +2953,6 @@ class lshr_exprt:public shift_exprt
2953
2953
}
2954
2954
};
2955
2955
2956
- // / \brief Bit-vector replication
2957
- class replication_exprt :public binary_exprt
2958
- {
2959
- public:
2960
- DEPRECATED (" use replication_exprt(times, value) instead" )
2961
- replication_exprt ():binary_exprt(ID_replication)
2962
- {
2963
- }
2964
-
2965
- DEPRECATED (" use replication_exprt(times, value) instead" )
2966
- explicit replication_exprt (const typet &_type):
2967
- binary_exprt(ID_replication, _type)
2968
- {
2969
- }
2970
-
2971
- replication_exprt (const exprt &_times, const exprt &_src):
2972
- binary_exprt (_times, ID_replication, _src)
2973
- {
2974
- }
2975
-
2976
- exprt × ()
2977
- {
2978
- return op0 ();
2979
- }
2980
-
2981
- const exprt × () const
2982
- {
2983
- return op0 ();
2984
- }
2985
-
2986
- exprt &op ()
2987
- {
2988
- return op1 ();
2989
- }
2990
-
2991
- const exprt &op () const
2992
- {
2993
- return op1 ();
2994
- }
2995
- };
2996
-
2997
- // / \brief Cast an exprt to a \ref replication_exprt
2998
- // /
2999
- // / \a expr must be known to be \ref replication_exprt.
3000
- // /
3001
- // / \param expr: Source expression
3002
- // / \return Object of type \ref replication_exprt
3003
- inline const replication_exprt &to_replication_expr (const exprt &expr)
3004
- {
3005
- PRECONDITION (expr.id ()==ID_replication);
3006
- DATA_INVARIANT (
3007
- expr.operands ().size ()==2 ,
3008
- " Bit-wise replication must have two operands" );
3009
- return static_cast <const replication_exprt &>(expr);
3010
- }
3011
-
3012
- // / \copydoc to_replication_expr(const exprt &)
3013
- inline replication_exprt &to_replication_expr (exprt &expr)
3014
- {
3015
- PRECONDITION (expr.id ()==ID_replication);
3016
- DATA_INVARIANT (
3017
- expr.operands ().size ()==2 ,
3018
- " Bit-wise replication must have two operands" );
3019
- return static_cast <replication_exprt &>(expr);
3020
- }
3021
-
3022
- template <> inline bool can_cast_expr<replication_exprt>(const exprt &base)
3023
- {
3024
- return base.id ()==ID_replication;
3025
- }
3026
- inline void validate_expr (const replication_exprt &value)
3027
- {
3028
- validate_operands (value, 2 , " Bit-wise replication must have two operands" );
3029
- }
3030
-
3031
-
3032
2956
// / \brief Extracts a single bit of a bit-vector operand
3033
2957
class extractbit_exprt :public binary_predicate_exprt
3034
2958
{
@@ -4420,6 +4344,80 @@ class null_pointer_exprt:public constant_exprt
4420
4344
}
4421
4345
};
4422
4346
4347
+ // / \brief Bit-vector replication
4348
+ class replication_exprt : public binary_exprt
4349
+ {
4350
+ public:
4351
+ DEPRECATED (" use replication_exprt(times, value) instead" )
4352
+ replication_exprt () : binary_exprt(ID_replication)
4353
+ {
4354
+ }
4355
+
4356
+ DEPRECATED (" use replication_exprt(times, value) instead" )
4357
+ explicit replication_exprt (const typet &_type)
4358
+ : binary_exprt(ID_replication, _type)
4359
+ {
4360
+ }
4361
+
4362
+ replication_exprt (const constant_exprt &_times, const exprt &_src)
4363
+ : binary_exprt(_times, ID_replication, _src)
4364
+ {
4365
+ }
4366
+
4367
+ constant_exprt × ()
4368
+ {
4369
+ return static_cast <constant_exprt &>(op0 ());
4370
+ }
4371
+
4372
+ const constant_exprt × () const
4373
+ {
4374
+ return static_cast <const constant_exprt &>(op0 ());
4375
+ }
4376
+
4377
+ exprt &op ()
4378
+ {
4379
+ return op1 ();
4380
+ }
4381
+
4382
+ const exprt &op () const
4383
+ {
4384
+ return op1 ();
4385
+ }
4386
+ };
4387
+
4388
+ // / \brief Cast an exprt to a \ref replication_exprt
4389
+ // /
4390
+ // / \a expr must be known to be \ref replication_exprt.
4391
+ // /
4392
+ // / \param expr: Source expression
4393
+ // / \return Object of type \ref replication_exprt
4394
+ inline const replication_exprt &to_replication_expr (const exprt &expr)
4395
+ {
4396
+ PRECONDITION (expr.id () == ID_replication);
4397
+ DATA_INVARIANT (
4398
+ expr.operands ().size () == 2 , " Bit-wise replication must have two operands" );
4399
+ return static_cast <const replication_exprt &>(expr);
4400
+ }
4401
+
4402
+ // / \copydoc to_replication_expr(const exprt &)
4403
+ inline replication_exprt &to_replication_expr (exprt &expr)
4404
+ {
4405
+ PRECONDITION (expr.id () == ID_replication);
4406
+ DATA_INVARIANT (
4407
+ expr.operands ().size () == 2 , " Bit-wise replication must have two operands" );
4408
+ return static_cast <replication_exprt &>(expr);
4409
+ }
4410
+
4411
+ template <>
4412
+ inline bool can_cast_expr<replication_exprt>(const exprt &base)
4413
+ {
4414
+ return base.id () == ID_replication;
4415
+ }
4416
+ inline void validate_expr (const replication_exprt &value)
4417
+ {
4418
+ validate_operands (value, 2 , " Bit-wise replication must have two operands" );
4419
+ }
4420
+
4423
4421
// / \brief Concatenation of bit-vector operands
4424
4422
// /
4425
4423
// / This expression takes any number of operands
0 commit comments