5
5
This file is part of GCC.
6
6
7
7
GCC is free software; you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
8
9
the Free Software Foundation; either version 3, or (at your option)
9
10
any later version.
10
11
@@ -190,7 +191,7 @@ lookup_concrete_semantic (const char *name)
190
191
return CCS_INVALID;
191
192
}
192
193
193
- /* Compare role and name up to either the NULL terminator or the first
194
+ /* Compare role and name up to either the NUL terminator or the first
194
195
occurrence of colon. */
195
196
196
197
static bool
@@ -516,15 +517,15 @@ contract_config_to_mode (tree config)
516
517
if (!role)
517
518
role = get_default_contract_role ();
518
519
519
- contract_level level =
520
- map_contract_level (IDENTIFIER_POINTER (TREE_VALUE (config)));
520
+ contract_level level
521
+ = map_contract_level (IDENTIFIER_POINTER (TREE_VALUE (config)));
521
522
return contract_mode (level, role);
522
523
}
523
524
524
525
/* Literal semantic. */
525
526
gcc_assert (TREE_CODE (config) == IDENTIFIER_NODE);
526
- contract_semantic semantic =
527
- map_contract_semantic (IDENTIFIER_POINTER (config));
527
+ contract_semantic semantic
528
+ = map_contract_semantic (IDENTIFIER_POINTER (config));
528
529
return contract_mode (semantic);
529
530
}
530
531
@@ -586,8 +587,8 @@ all_attributes_are_contracts_p (tree attributes)
586
587
tree
587
588
invalidate_contract (tree contract)
588
589
{
589
- if (TREE_CODE (contract) == POSTCONDITION_STMT &&
590
- POSTCONDITION_IDENTIFIER (contract))
590
+ if (TREE_CODE (contract) == POSTCONDITION_STMT
591
+ && POSTCONDITION_IDENTIFIER (contract))
591
592
POSTCONDITION_IDENTIFIER (contract) = error_mark_node;
592
593
CONTRACT_CONDITION (contract) = error_mark_node;
593
594
CONTRACT_COMMENT (contract) = error_mark_node;
@@ -783,8 +784,8 @@ grok_contract (tree attribute, tree mode, tree result, cp_expr condition,
783
784
contract_semantic semantic = compute_concrete_semantic (contract);
784
785
if (flag_contracts_nonattr
785
786
&& OPTION_SET_P (flag_contract_evaluation_semantic))
786
- semantic =
787
- static_cast <contract_semantic>(flag_contract_evaluation_semantic);
787
+ semantic
788
+ = static_cast <contract_semantic>(flag_contract_evaluation_semantic);
788
789
set_contract_semantic (contract, semantic);
789
790
790
791
/* If the contract is deferred, don't do anything with the condition. */
@@ -2624,8 +2625,8 @@ emit_assertion (tree attr)
2624
2625
2625
2626
emit_contract_attr (attr);
2626
2627
2627
- contract_semantic semantic =
2628
- get_contract_semantic (CONTRACT_STATEMENT (attr));
2628
+ contract_semantic semantic
2629
+ = get_contract_semantic (CONTRACT_STATEMENT (attr));
2629
2630
2630
2631
if (semantic == CCS_OBSERVE)
2631
2632
{
@@ -2728,8 +2729,7 @@ constify_contract_access(tree decl)
2728
2729
|| (TREE_CODE (decl) == PARM_DECL)
2729
2730
|| (REFERENCE_REF_P (decl)
2730
2731
&& ((VAR_P (TREE_OPERAND (decl, 0 ))
2731
- && decl_storage_duration
2732
- (TREE_OPERAND (decl, 0 )) == dk_auto)
2732
+ && decl_storage_duration (TREE_OPERAND (decl, 0 )) == dk_auto)
2733
2733
|| (TREE_CODE (TREE_OPERAND (decl, 0 )) == PARM_DECL)))))
2734
2734
{
2735
2735
decl = view_as_const (decl);
@@ -2820,8 +2820,8 @@ start_function_contracts (tree fndecl)
2820
2820
2821
2821
/* If this is not a client side check and definition side checks are
2822
2822
disabled, do nothing. */
2823
- if (!flag_contracts_nonattr_definition_check &&
2824
- !DECL_CONTRACT_WRAPPER (fndecl))
2823
+ if (!flag_contracts_nonattr_definition_check
2824
+ && !DECL_CONTRACT_WRAPPER (fndecl))
2825
2825
return ;
2826
2826
2827
2827
/* Check that the user did not try to shadow a function parameter with the
@@ -2942,8 +2942,8 @@ maybe_apply_function_contracts (tree fndecl)
2942
2942
2943
2943
/* If this is not a client side check and definition side checks are
2944
2944
disabled, do nothing. */
2945
- if (!flag_contracts_nonattr_definition_check &&
2946
- !DECL_CONTRACT_WRAPPER (fndecl))
2945
+ if (!flag_contracts_nonattr_definition_check
2946
+ && !DECL_CONTRACT_WRAPPER (fndecl))
2947
2947
return ;
2948
2948
2949
2949
bool do_pre = has_active_preconditions (fndecl);
@@ -3036,8 +3036,8 @@ copy_and_remap_contracts (tree dest, tree source, bool remap_result = true,
3036
3036
a != NULL_TREE;
3037
3037
a = CONTRACT_CHAIN (a))
3038
3038
{
3039
- if (!remap_post &&
3040
- (TREE_CODE (CONTRACT_STATEMENT (a)) == POSTCONDITION_STMT))
3039
+ if (!remap_post
3040
+ && (TREE_CODE (CONTRACT_STATEMENT (a)) == POSTCONDITION_STMT))
3041
3041
continue ;
3042
3042
3043
3043
tree c = copy_node (a);
@@ -3047,16 +3047,16 @@ copy_and_remap_contracts (tree dest, tree source, bool remap_result = true,
3047
3047
remap_contract (source, dest, CONTRACT_STATEMENT (c),
3048
3048
/* duplicate_p=*/ true );
3049
3049
3050
- if ( remap_result &&
3051
- (TREE_CODE (CONTRACT_STATEMENT (c)) == POSTCONDITION_STMT))
3050
+ if (remap_result
3051
+ && (TREE_CODE (CONTRACT_STATEMENT (c)) == POSTCONDITION_STMT))
3052
3052
{
3053
3053
tree oldvar = POSTCONDITION_IDENTIFIER (CONTRACT_STATEMENT (c));
3054
3054
if (oldvar)
3055
3055
DECL_CONTEXT (oldvar) = dest;
3056
3056
}
3057
3057
3058
- CONTRACT_COMMENT (CONTRACT_STATEMENT (c)) =
3059
- copy_node (CONTRACT_COMMENT (CONTRACT_STATEMENT (c)));
3058
+ CONTRACT_COMMENT (CONTRACT_STATEMENT (c))
3059
+ = copy_node (CONTRACT_COMMENT (CONTRACT_STATEMENT (c)));
3060
3060
3061
3061
chainon (last, c);
3062
3062
last = c;
@@ -3085,8 +3085,8 @@ finish_function_contracts (tree fndecl)
3085
3085
3086
3086
/* If this is not a client side check and definition side checks are
3087
3087
disabled, do nothing. */
3088
- if (!flag_contracts_nonattr_definition_check &&
3089
- !DECL_CONTRACT_WRAPPER (fndecl))
3088
+ if (!flag_contracts_nonattr_definition_check
3089
+ && !DECL_CONTRACT_WRAPPER (fndecl))
3090
3090
return ;
3091
3091
3092
3092
for (tree ca = DECL_CONTRACTS (fndecl); ca; ca = CONTRACT_CHAIN (ca))
@@ -3137,8 +3137,10 @@ finish_function_contracts (tree fndecl)
3137
3137
if (wrapdecl){
3138
3138
/* we copy postconditions on virtual function wrapper calls or if
3139
3139
postcondition checks are enabled on the caller side. */
3140
- bool copy_post = (flag_contract_nonattr_client_check > 1 ) ||
3141
- ((DECL_IOBJ_MEMBER_FUNCTION_P (fndecl) && DECL_VIRTUAL_P (fndecl)));
3140
+ bool copy_post
3141
+ = (flag_contract_nonattr_client_check > 1 )
3142
+ || ((DECL_IOBJ_MEMBER_FUNCTION_P (fndecl)
3143
+ && DECL_VIRTUAL_P (fndecl)));
3142
3144
3143
3145
copy_and_remap_contracts (wrapdecl, fndecl, true , copy_post);
3144
3146
}
@@ -3395,8 +3397,9 @@ maybe_contract_wrap_call (tree fndecl, tree call)
3395
3397
3396
3398
/* we check postconditions on vitual function wrapper calls or if
3397
3399
postcondition checks are enabled on the caller side. */
3398
- bool check_post = (flag_contract_nonattr_client_check > 1 ) ||
3399
- (DECL_IOBJ_MEMBER_FUNCTION_P (fndecl) && DECL_VIRTUAL_P (fndecl));
3400
+ bool check_post
3401
+ = (flag_contract_nonattr_client_check > 1 )
3402
+ || (DECL_IOBJ_MEMBER_FUNCTION_P (fndecl) && DECL_VIRTUAL_P (fndecl));
3400
3403
3401
3404
bool do_pre = has_active_preconditions (fndecl);
3402
3405
bool do_post = has_active_postconditions (fndecl);
0 commit comments