@@ -2462,13 +2462,13 @@ inline verilog_udpt &to_verilog_udp(irept &irep)
2462
2462
}
2463
2463
2464
2464
// / size'(expression)
2465
- class verilog_size_cast_exprt : public binary_exprt
2465
+ class verilog_explicit_size_cast_exprt : public binary_exprt
2466
2466
{
2467
2467
public:
2468
- verilog_size_cast_exprt (exprt __size, exprt __op, typet __type)
2468
+ verilog_explicit_size_cast_exprt (exprt __size, exprt __op, typet __type)
2469
2469
: binary_exprt(
2470
2470
std::move (__size),
2471
- ID_verilog_size_cast ,
2471
+ ID_verilog_explicit_size_cast ,
2472
2472
std::move(__op),
2473
2473
std::move(__type))
2474
2474
{
@@ -2501,24 +2501,97 @@ class verilog_size_cast_exprt : public binary_exprt
2501
2501
}
2502
2502
};
2503
2503
2504
- inline const verilog_size_cast_exprt &
2505
- to_verilog_size_cast_expr (const exprt &expr)
2504
+ inline const verilog_explicit_size_cast_exprt &
2505
+ to_verilog_explicit_size_cast_expr (const exprt &expr)
2506
2506
{
2507
- verilog_size_cast_exprt ::check (expr);
2508
- return static_cast <const verilog_size_cast_exprt &>(expr);
2507
+ verilog_explicit_size_cast_exprt ::check (expr);
2508
+ return static_cast <const verilog_explicit_size_cast_exprt &>(expr);
2509
2509
}
2510
2510
2511
- inline verilog_size_cast_exprt &to_verilog_size_cast_expr (exprt &expr)
2511
+ inline verilog_explicit_size_cast_exprt &
2512
+ to_verilog_explicit_size_cast_expr (exprt &expr)
2512
2513
{
2513
- verilog_size_cast_exprt ::check (expr);
2514
- return static_cast <verilog_size_cast_exprt &>(expr);
2514
+ verilog_explicit_size_cast_exprt ::check (expr);
2515
+ return static_cast <verilog_explicit_size_cast_exprt &>(expr);
2515
2516
}
2516
2517
2517
- class verilog_explicit_cast_exprt : public unary_exprt
2518
+ class verilog_explicit_const_cast_exprt : public unary_exprt
2518
2519
{
2519
2520
public:
2520
- verilog_explicit_cast_exprt (exprt __op, typet __type)
2521
- : unary_exprt(ID_verilog_explicit_cast, std::move(__op), std::move(__type))
2521
+ verilog_explicit_const_cast_exprt (exprt __op, typet __type)
2522
+ : unary_exprt(
2523
+ ID_verilog_explicit_const_cast,
2524
+ std::move (__op),
2525
+ std::move(__type))
2526
+ {
2527
+ }
2528
+
2529
+ exprt lower () const
2530
+ {
2531
+ return typecast_exprt{op (), type ()};
2532
+ }
2533
+ };
2534
+
2535
+ inline const verilog_explicit_const_cast_exprt &
2536
+ to_verilog_explicit_const_cast_expr (const exprt &expr)
2537
+ {
2538
+ verilog_explicit_const_cast_exprt::check (expr);
2539
+ return static_cast <const verilog_explicit_const_cast_exprt &>(expr);
2540
+ }
2541
+
2542
+ inline verilog_explicit_const_cast_exprt &
2543
+ to_verilog_explicit_const_cast_expr (exprt &expr)
2544
+ {
2545
+ verilog_explicit_const_cast_exprt::check (expr);
2546
+ return static_cast <verilog_explicit_const_cast_exprt &>(expr);
2547
+ }
2548
+
2549
+ class verilog_explicit_signing_cast_exprt : public unary_exprt
2550
+ {
2551
+ public:
2552
+ verilog_explicit_signing_cast_exprt (exprt __op, typet __type)
2553
+ : unary_exprt(
2554
+ ID_verilog_explicit_signing_cast,
2555
+ std::move (__op),
2556
+ std::move(__type))
2557
+ {
2558
+ }
2559
+
2560
+ bool is_signed () const
2561
+ {
2562
+ auto &dest_type = type ();
2563
+ return dest_type.id () == ID_signedbv ||
2564
+ dest_type.id () == ID_verilog_signedbv;
2565
+ }
2566
+
2567
+ exprt lower () const
2568
+ {
2569
+ return typecast_exprt{op (), type ()};
2570
+ }
2571
+ };
2572
+
2573
+ inline const verilog_explicit_signing_cast_exprt &
2574
+ to_verilog_explicit_signing_cast_expr (const exprt &expr)
2575
+ {
2576
+ verilog_explicit_signing_cast_exprt::check (expr);
2577
+ return static_cast <const verilog_explicit_signing_cast_exprt &>(expr);
2578
+ }
2579
+
2580
+ inline verilog_explicit_signing_cast_exprt &
2581
+ to_verilog_explicit_signing_cast_expr (exprt &expr)
2582
+ {
2583
+ verilog_explicit_signing_cast_exprt::check (expr);
2584
+ return static_cast <verilog_explicit_signing_cast_exprt &>(expr);
2585
+ }
2586
+
2587
+ class verilog_explicit_type_cast_exprt : public unary_exprt
2588
+ {
2589
+ public:
2590
+ verilog_explicit_type_cast_exprt (exprt __op, typet __type)
2591
+ : unary_exprt(
2592
+ ID_verilog_explicit_type_cast,
2593
+ std::move (__op),
2594
+ std::move(__type))
2522
2595
{
2523
2596
}
2524
2597
@@ -2528,17 +2601,18 @@ class verilog_explicit_cast_exprt : public unary_exprt
2528
2601
}
2529
2602
};
2530
2603
2531
- inline const verilog_explicit_cast_exprt &
2532
- to_verilog_explicit_cast_expr (const exprt &expr)
2604
+ inline const verilog_explicit_type_cast_exprt &
2605
+ to_verilog_explicit_type_cast_expr (const exprt &expr)
2533
2606
{
2534
- verilog_explicit_cast_exprt ::check (expr);
2535
- return static_cast <const verilog_explicit_cast_exprt &>(expr);
2607
+ verilog_explicit_type_cast_exprt ::check (expr);
2608
+ return static_cast <const verilog_explicit_type_cast_exprt &>(expr);
2536
2609
}
2537
2610
2538
- inline verilog_explicit_cast_exprt &to_verilog_explicit_cast_expr (exprt &expr)
2611
+ inline verilog_explicit_type_cast_exprt &
2612
+ to_verilog_explicit_type_cast_expr (exprt &expr)
2539
2613
{
2540
- verilog_explicit_cast_exprt ::check (expr);
2541
- return static_cast <verilog_explicit_cast_exprt &>(expr);
2614
+ verilog_explicit_type_cast_exprt ::check (expr);
2615
+ return static_cast <verilog_explicit_type_cast_exprt &>(expr);
2542
2616
}
2543
2617
2544
2618
class verilog_implicit_typecast_exprt : public unary_exprt
0 commit comments