diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
commit | 071b4126c613881f4cb25b4e5c39032964827f88 (patch) | |
tree | 7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/cp/contracts.cc | |
parent | 845d23f3ea08ba873197c275a8857eee7edad996 (diff) | |
parent | caa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff) | |
download | gcc-devel/gfortran-test.zip gcc-devel/gfortran-test.tar.gz gcc-devel/gfortran-test.tar.bz2 |
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/cp/contracts.cc')
-rw-r--r-- | gcc/cp/contracts.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc index d0cfd2e..042524d 100644 --- a/gcc/cp/contracts.cc +++ b/gcc/cp/contracts.cc @@ -159,7 +159,7 @@ bool valid_configs[CCS_MAYBE + 1][CCS_MAYBE + 1] = { { 0, 1, 0, 0, 1, }, }; -void +static void validate_contract_role (contract_role *role) { gcc_assert (role); @@ -171,7 +171,7 @@ validate_contract_role (contract_role *role) "the %<default%> semantic"); } -contract_semantic +static contract_semantic lookup_concrete_semantic (const char *name) { if (strcmp (name, "ignore") == 0) @@ -210,7 +210,9 @@ role_name_equal (contract_role *role, const char *name) return role_name_equal (role->name, name); } -contract_role * +static void setup_default_contract_role (bool update = true); + +static contract_role * get_contract_role (const char *name) { for (int i = 0; i < max_custom_roles; ++i) @@ -227,12 +229,12 @@ get_contract_role (const char *name) return NULL; } -contract_role * +static contract_role * add_contract_role (const char *name, contract_semantic des, contract_semantic aus, contract_semantic axs, - bool update) + bool update = true) { for (int i = 0; i < max_custom_roles; ++i) { @@ -271,7 +273,7 @@ get_concrete_axiom_semantic () return flag_contract_assumption_mode ? CCS_ASSUME : CCS_IGNORE; } -void +static void setup_default_contract_role (bool update) { contract_semantic check = get_concrete_check (); @@ -491,6 +493,14 @@ handle_OPT_fcontract_semantic_ (const char *arg) validate_contract_role (role); } +/* Returns the default role. */ + +static contract_role * +get_default_contract_role () +{ + return get_contract_role ("default"); +} + /* Convert a contract CONFIG into a contract_mode. */ static contract_mode |