@@ -2405,139 +2405,139 @@ bool simplify_exprt::simplify_node_preorder(exprt &expr)
2405
2405
bool simplify_exprt::simplify_node (exprt &expr)
2406
2406
{
2407
2407
if (!expr.has_operands ())
2408
- return true ;
2408
+ return true ; // no change
2409
2409
2410
- // #define DEBUGX
2410
+ // #define DEBUGX
2411
2411
2412
- #ifdef DEBUGX
2412
+ #ifdef DEBUGX
2413
2413
exprt old (expr);
2414
- #endif
2414
+ #endif
2415
2415
2416
- bool result= true ;
2416
+ bool no_change = true ;
2417
2417
2418
- result= sort_and_join (expr) && result ;
2418
+ no_change = sort_and_join (expr) && no_change ;
2419
2419
2420
2420
if (expr.id ()==ID_typecast)
2421
- result= simplify_typecast (expr) && result ;
2421
+ no_change = simplify_typecast (expr) && no_change ;
2422
2422
else if (expr.id ()==ID_equal || expr.id ()==ID_notequal ||
2423
2423
expr.id ()==ID_gt || expr.id ()==ID_lt ||
2424
2424
expr.id ()==ID_ge || expr.id ()==ID_le)
2425
- result= simplify_inequality (expr) && result ;
2425
+ no_change = simplify_inequality (expr) && no_change ;
2426
2426
else if (expr.id ()==ID_if)
2427
- result= simplify_if (to_if_expr (expr)) && result ;
2427
+ no_change = simplify_if (to_if_expr (expr)) && no_change ;
2428
2428
else if (expr.id ()==ID_lambda)
2429
- result= simplify_lambda (expr) && result ;
2429
+ no_change = simplify_lambda (expr) && no_change ;
2430
2430
else if (expr.id ()==ID_with)
2431
- result= simplify_with (expr) && result ;
2431
+ no_change = simplify_with (expr) && no_change ;
2432
2432
else if (expr.id ()==ID_update)
2433
- result= simplify_update (expr) && result ;
2433
+ no_change = simplify_update (expr) && no_change ;
2434
2434
else if (expr.id ()==ID_index)
2435
- result= simplify_index (expr) && result ;
2435
+ no_change = simplify_index (expr) && no_change ;
2436
2436
else if (expr.id ()==ID_member)
2437
- result= simplify_member (expr) && result ;
2437
+ no_change = simplify_member (expr) && no_change ;
2438
2438
else if (expr.id ()==ID_byte_update_little_endian ||
2439
2439
expr.id ()==ID_byte_update_big_endian)
2440
- result= simplify_byte_update (to_byte_update_expr (expr)) && result ;
2440
+ no_change = simplify_byte_update (to_byte_update_expr (expr)) && no_change ;
2441
2441
else if (expr.id ()==ID_byte_extract_little_endian ||
2442
2442
expr.id ()==ID_byte_extract_big_endian)
2443
- result= simplify_byte_extract (to_byte_extract_expr (expr)) && result ;
2443
+ no_change = simplify_byte_extract (to_byte_extract_expr (expr)) && no_change ;
2444
2444
else if (expr.id ()==ID_pointer_object)
2445
- result= simplify_pointer_object (expr) && result ;
2445
+ no_change = simplify_pointer_object (expr) && no_change ;
2446
2446
else if (expr.id () == ID_is_dynamic_object)
2447
2447
{
2448
- result = simplify_is_dynamic_object (expr) && result ;
2448
+ no_change = simplify_is_dynamic_object (expr) && no_change ;
2449
2449
}
2450
2450
else if (expr.id () == ID_is_invalid_pointer)
2451
- result = simplify_is_invalid_pointer (expr) && result ;
2451
+ no_change = simplify_is_invalid_pointer (expr) && no_change ;
2452
2452
else if (expr.id ()==ID_object_size)
2453
- result= simplify_object_size (expr) && result ;
2453
+ no_change = simplify_object_size (expr) && no_change ;
2454
2454
else if (expr.id ()==ID_good_pointer)
2455
- result= simplify_good_pointer (expr) && result ;
2455
+ no_change = simplify_good_pointer (expr) && no_change ;
2456
2456
else if (expr.id ()==ID_div)
2457
- result= simplify_div (expr) && result ;
2457
+ no_change = simplify_div (expr) && no_change ;
2458
2458
else if (expr.id ()==ID_mod)
2459
- result= simplify_mod (expr) && result ;
2459
+ no_change = simplify_mod (expr) && no_change ;
2460
2460
else if (expr.id ()==ID_bitnot)
2461
- result= simplify_bitnot (expr) && result ;
2461
+ no_change = simplify_bitnot (expr) && no_change ;
2462
2462
else if (expr.id ()==ID_bitand ||
2463
2463
expr.id ()==ID_bitor ||
2464
2464
expr.id ()==ID_bitxor)
2465
- result= simplify_bitwise (expr) && result ;
2465
+ no_change = simplify_bitwise (expr) && no_change ;
2466
2466
else if (expr.id ()==ID_ashr || expr.id ()==ID_lshr || expr.id ()==ID_shl)
2467
- result= simplify_shifts (expr) && result ;
2467
+ no_change = simplify_shifts (expr) && no_change ;
2468
2468
else if (expr.id ()==ID_power)
2469
- result= simplify_power (expr) && result ;
2469
+ no_change = simplify_power (expr) && no_change ;
2470
2470
else if (expr.id ()==ID_plus)
2471
- result= simplify_plus (expr) && result ;
2471
+ no_change = simplify_plus (expr) && no_change ;
2472
2472
else if (expr.id ()==ID_minus)
2473
- result= simplify_minus (expr) && result ;
2473
+ no_change = simplify_minus (expr) && no_change ;
2474
2474
else if (expr.id ()==ID_mult)
2475
- result= simplify_mult (expr) && result ;
2475
+ no_change = simplify_mult (expr) && no_change ;
2476
2476
else if (expr.id ()==ID_floatbv_plus ||
2477
2477
expr.id ()==ID_floatbv_minus ||
2478
2478
expr.id ()==ID_floatbv_mult ||
2479
2479
expr.id ()==ID_floatbv_div)
2480
- result= simplify_floatbv_op (expr) && result ;
2480
+ no_change = simplify_floatbv_op (expr) && no_change ;
2481
2481
else if (expr.id ()==ID_floatbv_typecast)
2482
- result= simplify_floatbv_typecast (expr) && result ;
2482
+ no_change = simplify_floatbv_typecast (expr) && no_change ;
2483
2483
else if (expr.id ()==ID_unary_minus)
2484
- result= simplify_unary_minus (expr) && result ;
2484
+ no_change = simplify_unary_minus (expr) && no_change ;
2485
2485
else if (expr.id ()==ID_unary_plus)
2486
- result= simplify_unary_plus (expr) && result ;
2486
+ no_change = simplify_unary_plus (expr) && no_change ;
2487
2487
else if (expr.id ()==ID_not)
2488
- result= simplify_not (expr) && result ;
2488
+ no_change = simplify_not (expr) && no_change ;
2489
2489
else if (expr.id ()==ID_implies ||
2490
2490
expr.id ()==ID_or || expr.id ()==ID_xor ||
2491
2491
expr.id ()==ID_and)
2492
- result= simplify_boolean (expr) && result ;
2492
+ no_change = simplify_boolean (expr) && no_change ;
2493
2493
else if (expr.id ()==ID_dereference)
2494
- result= simplify_dereference (expr) && result ;
2494
+ no_change = simplify_dereference (expr) && no_change ;
2495
2495
else if (expr.id ()==ID_address_of)
2496
- result= simplify_address_of (expr) && result ;
2496
+ no_change = simplify_address_of (expr) && no_change ;
2497
2497
else if (expr.id ()==ID_pointer_offset)
2498
- result= simplify_pointer_offset (expr) && result ;
2498
+ no_change = simplify_pointer_offset (expr) && no_change ;
2499
2499
else if (expr.id ()==ID_extractbit)
2500
- result= simplify_extractbit (expr) && result ;
2500
+ no_change = simplify_extractbit (expr) && no_change ;
2501
2501
else if (expr.id ()==ID_concatenation)
2502
- result= simplify_concatenation (expr) && result ;
2502
+ no_change = simplify_concatenation (expr) && no_change ;
2503
2503
else if (expr.id ()==ID_extractbits)
2504
- result = simplify_extractbits (to_extractbits_expr (expr)) && result ;
2504
+ no_change = simplify_extractbits (to_extractbits_expr (expr)) && no_change ;
2505
2505
else if (expr.id ()==ID_ieee_float_equal ||
2506
2506
expr.id ()==ID_ieee_float_notequal)
2507
- result= simplify_ieee_float_relation (expr) && result ;
2507
+ no_change = simplify_ieee_float_relation (expr) && no_change ;
2508
2508
else if (expr.id () == ID_bswap)
2509
- result = simplify_bswap (to_bswap_expr (expr)) && result ;
2509
+ no_change = simplify_bswap (to_bswap_expr (expr)) && no_change ;
2510
2510
else if (expr.id ()==ID_isinf)
2511
- result= simplify_isinf (expr) && result ;
2511
+ no_change = simplify_isinf (expr) && no_change ;
2512
2512
else if (expr.id ()==ID_isnan)
2513
- result= simplify_isnan (expr) && result ;
2513
+ no_change = simplify_isnan (expr) && no_change ;
2514
2514
else if (expr.id ()==ID_isnormal)
2515
- result= simplify_isnormal (expr) && result ;
2515
+ no_change = simplify_isnormal (expr) && no_change ;
2516
2516
else if (expr.id ()==ID_abs)
2517
- result= simplify_abs (expr) && result ;
2517
+ no_change = simplify_abs (expr) && no_change ;
2518
2518
else if (expr.id ()==ID_sign)
2519
- result= simplify_sign (expr) && result ;
2519
+ no_change = simplify_sign (expr) && no_change ;
2520
2520
else if (expr.id () == ID_popcount)
2521
- result = simplify_popcount (to_popcount_expr (expr)) && result ;
2521
+ no_change = simplify_popcount (to_popcount_expr (expr)) && no_change ;
2522
2522
else if (expr.id () == ID_function_application)
2523
- result = simplify_function_application (expr) && result ;
2523
+ no_change = simplify_function_application (expr) && no_change ;
2524
2524
else if (expr.id () == ID_complex_real || expr.id () == ID_complex_imag)
2525
- result = simplify_complex (expr) && result ;
2525
+ no_change = simplify_complex (expr) && no_change ;
2526
2526
2527
2527
#ifdef DEBUGX
2528
2528
if (
2529
- !result
2530
- #ifdef DEBUG_ON_DEMAND
2529
+ !no_change
2530
+ # ifdef DEBUG_ON_DEMAND
2531
2531
&& debug_on
2532
- #endif
2532
+ # endif
2533
2533
)
2534
2534
{
2535
2535
std::cout << " ===== " << old.id () << " : " << format (old) << ' \n '
2536
2536
<< " ---> " << format (expr) << ' \n ' ;
2537
2537
}
2538
2538
#endif
2539
2539
2540
- return result ;
2540
+ return no_change ;
2541
2541
}
2542
2542
2543
2543
// / \return returns true if expression unchanged; returns false if changed
0 commit comments