Skip to content

Commit 5e8af57

Browse files
committed
std_expr.h: remove commented-out validation steps
Commented-out checks obviously don't check anything, and the code that was commented out wasn't particularly deep so that restoring it in future is trivial anyway.
1 parent 0a73e03 commit 5e8af57

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

src/util/std_expr.h

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,11 +2445,6 @@ inline bool can_cast_expr<and_exprt>(const exprt &base)
24452445
return base.id() == ID_and;
24462446
}
24472447

2448-
// inline void validate_expr(const and_exprt &value)
2449-
// {
2450-
// validate_operands(value, 2, "And must have two or more operands", true);
2451-
// }
2452-
24532448
/// \brief Cast an exprt to a \ref and_exprt
24542449
///
24552450
/// \a expr must be known to be \ref and_exprt.
@@ -2459,19 +2454,13 @@ inline bool can_cast_expr<and_exprt>(const exprt &base)
24592454
inline const and_exprt &to_and_expr(const exprt &expr)
24602455
{
24612456
PRECONDITION(expr.id()==ID_and);
2462-
// DATA_INVARIANT(
2463-
// expr.operands().size()>=2,
2464-
// "And must have two or more operands");
24652457
return static_cast<const and_exprt &>(expr);
24662458
}
24672459

24682460
/// \copydoc to_and_expr(const exprt &)
24692461
inline and_exprt &to_and_expr(exprt &expr)
24702462
{
24712463
PRECONDITION(expr.id()==ID_and);
2472-
// DATA_INVARIANT(
2473-
// expr.operands().size()>=2,
2474-
// "And must have two or more operands");
24752464
return static_cast<and_exprt &>(expr);
24762465
}
24772466

@@ -2570,11 +2559,6 @@ inline bool can_cast_expr<or_exprt>(const exprt &base)
25702559
return base.id() == ID_or;
25712560
}
25722561

2573-
// inline void validate_expr(const or_exprt &value)
2574-
// {
2575-
// validate_operands(value, 2, "Or must have two or more operands", true);
2576-
// }
2577-
25782562
/// \brief Cast an exprt to a \ref or_exprt
25792563
///
25802564
/// \a expr must be known to be \ref or_exprt.
@@ -2584,19 +2568,13 @@ inline bool can_cast_expr<or_exprt>(const exprt &base)
25842568
inline const or_exprt &to_or_expr(const exprt &expr)
25852569
{
25862570
PRECONDITION(expr.id()==ID_or);
2587-
// DATA_INVARIANT(
2588-
// expr.operands().size()>=2,
2589-
// "Or must have two or more operands");
25902571
return static_cast<const or_exprt &>(expr);
25912572
}
25922573

25932574
/// \copydoc to_or_expr(const exprt &)
25942575
inline or_exprt &to_or_expr(exprt &expr)
25952576
{
25962577
PRECONDITION(expr.id()==ID_or);
2597-
// DATA_INVARIANT(
2598-
// expr.operands().size()>=2,
2599-
// "Or must have two or more operands");
26002578
return static_cast<or_exprt &>(expr);
26012579
}
26022580

@@ -2622,15 +2600,6 @@ inline bool can_cast_expr<xor_exprt>(const exprt &base)
26222600
return base.id() == ID_xor;
26232601
}
26242602

2625-
// inline void validate_expr(const bitxor_exprt &value)
2626-
// {
2627-
// validate_operands(
2628-
// value,
2629-
// 2,
2630-
// "Bit-wise xor must have two or more operands",
2631-
// true);
2632-
// }
2633-
26342603
/// \brief Cast an exprt to a \ref xor_exprt
26352604
///
26362605
/// \a expr must be known to be \ref xor_exprt.
@@ -2722,15 +2691,6 @@ inline bool can_cast_expr<bitor_exprt>(const exprt &base)
27222691
return base.id() == ID_bitor;
27232692
}
27242693

2725-
// inline void validate_expr(const bitor_exprt &value)
2726-
// {
2727-
// validate_operands(
2728-
// value,
2729-
// 2,
2730-
// "Bit-wise or must have two or more operands",
2731-
// true);
2732-
// }
2733-
27342694
/// \brief Cast an exprt to a \ref bitor_exprt
27352695
///
27362696
/// \a expr must be known to be \ref bitor_exprt.
@@ -2740,19 +2700,13 @@ inline bool can_cast_expr<bitor_exprt>(const exprt &base)
27402700
inline const bitor_exprt &to_bitor_expr(const exprt &expr)
27412701
{
27422702
PRECONDITION(expr.id()==ID_bitor);
2743-
// DATA_INVARIANT(
2744-
// expr.operands().size()>=2,
2745-
// "Bit-wise or must have two or more operands");
27462703
return static_cast<const bitor_exprt &>(expr);
27472704
}
27482705

27492706
/// \copydoc to_bitor_expr(const exprt &)
27502707
inline bitor_exprt &to_bitor_expr(exprt &expr)
27512708
{
27522709
PRECONDITION(expr.id()==ID_bitor);
2753-
// DATA_INVARIANT(
2754-
// expr.operands().size()>=2,
2755-
// "Bit-wise or must have two or more operands");
27562710
return static_cast<bitor_exprt &>(expr);
27572711
}
27582712

@@ -2778,15 +2732,6 @@ inline bool can_cast_expr<bitxor_exprt>(const exprt &base)
27782732
return base.id() == ID_bitxor;
27792733
}
27802734

2781-
// inline void validate_expr(const bitxor_exprt &value)
2782-
// {
2783-
// validate_operands(
2784-
// value,
2785-
// 2,
2786-
// "Bit-wise xor must have two or more operands",
2787-
// true);
2788-
// }
2789-
27902735
/// \brief Cast an exprt to a \ref bitxor_exprt
27912736
///
27922737
/// \a expr must be known to be \ref bitxor_exprt.
@@ -2796,19 +2741,13 @@ inline bool can_cast_expr<bitxor_exprt>(const exprt &base)
27962741
inline const bitxor_exprt &to_bitxor_expr(const exprt &expr)
27972742
{
27982743
PRECONDITION(expr.id()==ID_bitxor);
2799-
// DATA_INVARIANT(
2800-
// expr.operands().size()>=2,
2801-
// "Bit-wise xor must have two or more operands");
28022744
return static_cast<const bitxor_exprt &>(expr);
28032745
}
28042746

28052747
/// \copydoc to_bitxor_expr(const exprt &)
28062748
inline bitxor_exprt &to_bitxor_expr(exprt &expr)
28072749
{
28082750
PRECONDITION(expr.id()==ID_bitxor);
2809-
// DATA_INVARIANT(
2810-
// expr.operands().size()>=2,
2811-
// "Bit-wise xor must have two or more operands");
28122751
return static_cast<bitxor_exprt &>(expr);
28132752
}
28142753

@@ -2834,15 +2773,6 @@ inline bool can_cast_expr<bitand_exprt>(const exprt &base)
28342773
return base.id() == ID_bitand;
28352774
}
28362775

2837-
// inline void validate_expr(const bitand_exprt &value)
2838-
// {
2839-
// validate_operands(
2840-
// value,
2841-
// 2,
2842-
// "Bit-wise and must have two or more operands",
2843-
// true);
2844-
// }
2845-
28462776
/// \brief Cast an exprt to a \ref bitand_exprt
28472777
///
28482778
/// \a expr must be known to be \ref bitand_exprt.
@@ -2852,19 +2782,13 @@ inline bool can_cast_expr<bitand_exprt>(const exprt &base)
28522782
inline const bitand_exprt &to_bitand_expr(const exprt &expr)
28532783
{
28542784
PRECONDITION(expr.id()==ID_bitand);
2855-
// DATA_INVARIANT(
2856-
// expr.operands().size()>=2,
2857-
// "Bit-wise and must have two or more operands");
28582785
return static_cast<const bitand_exprt &>(expr);
28592786
}
28602787

28612788
/// \copydoc to_bitand_expr(const exprt &)
28622789
inline bitand_exprt &to_bitand_expr(exprt &expr)
28632790
{
28642791
PRECONDITION(expr.id()==ID_bitand);
2865-
// DATA_INVARIANT(
2866-
// expr.operands().size()>=2,
2867-
// "Bit-wise and must have two or more operands");
28682792
return static_cast<bitand_exprt &>(expr);
28692793
}
28702794

@@ -4566,17 +4490,6 @@ inline bool can_cast_expr<concatenation_exprt>(const exprt &base)
45664490
return base.id() == ID_concatenation;
45674491
}
45684492

4569-
// template<>
4570-
// inline void validate_expr<concatenation_exprt>(
4571-
// const concatenation_exprt &value)
4572-
// {
4573-
// validate_operands(
4574-
// value,
4575-
// 2,
4576-
// "Concatenation must have two or more operands",
4577-
// true);
4578-
// }
4579-
45804493
/// \brief Cast an exprt to a \ref concatenation_exprt
45814494
///
45824495
/// \a expr must be known to be \ref concatenation_exprt.
@@ -4586,19 +4499,13 @@ inline bool can_cast_expr<concatenation_exprt>(const exprt &base)
45864499
inline const concatenation_exprt &to_concatenation_expr(const exprt &expr)
45874500
{
45884501
PRECONDITION(expr.id()==ID_concatenation);
4589-
// DATA_INVARIANT(
4590-
// expr.operands().size()>=2,
4591-
// "Concatenation must have two or more operands");
45924502
return static_cast<const concatenation_exprt &>(expr);
45934503
}
45944504

45954505
/// \copydoc to_concatenation_expr(const exprt &)
45964506
inline concatenation_exprt &to_concatenation_expr(exprt &expr)
45974507
{
45984508
PRECONDITION(expr.id()==ID_concatenation);
4599-
// DATA_INVARIANT(
4600-
// expr.operands().size()>=2,
4601-
// "Concatenation must have two or more operands");
46024509
return static_cast<concatenation_exprt &>(expr);
46034510
}
46044511

0 commit comments

Comments
 (0)