diff options
author | Arsen Arsenović <arsen@aarsen.me> | 2022-12-15 18:56:59 +0100 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-12-15 16:48:00 -0500 |
commit | 52e7ff23ff5967fef52ebe31b6750a56f7103080 (patch) | |
tree | d6fb57f2a9f357ddb2d2e744cc0ddee434ec8e57 /gcc/cp/mangle.cc | |
parent | 147e276b580b674a46bc3b9c461ae7837fd48aba (diff) | |
download | gcc-52e7ff23ff5967fef52ebe31b6750a56f7103080.zip gcc-52e7ff23ff5967fef52ebe31b6750a56f7103080.tar.gz gcc-52e7ff23ff5967fef52ebe31b6750a56f7103080.tar.bz2 |
c++: mangle contracts in write_mangled_name
This fixes contract-checked extern "C" functions.
gcc/cp/ChangeLog:
* mangle.cc (write_encoding): Move contract pre/post function
mangling from here...
(write_mangled_name): ... to here, and make it happen always.
gcc/testsuite/ChangeLog:
* g++.dg/contracts/contracts-externC.C: New test.
Diffstat (limited to 'gcc/cp/mangle.cc')
-rw-r--r-- | gcc/cp/mangle.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index e363ef3..074cf27 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -798,6 +798,13 @@ write_mangled_name (const tree decl, bool top_level) write_string ("_Z"); write_encoding (decl); } + + /* If this is the pre/post function for a guarded function, append + .pre/post, like something from create_virtual_clone. */ + if (DECL_IS_PRE_FN_P (decl)) + write_string (".pre"); + else if (DECL_IS_POST_FN_P (decl)) + write_string (".post"); } /* Returns true if the return type of DECL is part of its signature, and @@ -856,13 +863,6 @@ write_encoding (const tree decl) mangle_return_type_p (decl), d); - /* If this is the pre/post function for a guarded function, append - .pre/post, like something from create_virtual_clone. */ - if (DECL_IS_PRE_FN_P (decl)) - write_string (".pre"); - else if (DECL_IS_POST_FN_P (decl)) - write_string (".post"); - /* If this is a coroutine helper, then append an appropriate string to identify which. */ if (tree ramp = DECL_RAMP_FN (decl)) |