[4/5] cp: Use get_mangled_id in more places in mangle_decl

Message ID 8f8d566a-df83-8562-0420-cb01592ad98c@e124511.cambridge.arm.com
State New
Headers
Series Fix fmv mangling for AArch64 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed

Commit Message

Andrew Carlotti Jan. 15, 2024, 11:28 a.m. UTC
  There's no functional change here, but it makes it clearer that all
three locations should be doing the same thing (aside from changes to
flag_abi_version).

gcc/cp/ChangeLog:

	* mangle.cc (mangle_decl): Consistently use get_mangled_id.
  

Comments

Jason Merrill Jan. 16, 2024, 8:24 p.m. UTC | #1
On 1/15/24 06:28, Andrew Carlotti wrote:
> There's no functional change here, but it makes it clearer that all
> three locations should be doing the same thing (aside from changes to
> flag_abi_version).

OK.

> gcc/cp/ChangeLog:
> 
> 	* mangle.cc (mangle_decl): Consistently use get_mangled_id.
> 
> 
> diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
> index a04bc584586f28cb80d21b5c6d647416aa8843df..9bd684608b9e3378292cdb042184ba603b3d69aa 100644
> --- a/gcc/cp/mangle.cc
> +++ b/gcc/cp/mangle.cc
> @@ -4503,8 +4503,7 @@ mangle_decl (const tree decl)
>   	    return;
>   
>   	  flag_abi_version = flag_abi_compat_version;
> -	  id2 = mangle_decl_string (decl);
> -	  id2 = targetm.mangle_decl_assembler_name (decl, id2);
> +	  id2 = get_mangled_id (decl);
>   	  flag_abi_version = save_ver;
>   
>   	  if (id2 != id)
> @@ -4519,8 +4518,7 @@ mangle_decl (const tree decl)
>   	      || id2 == NULL_TREE)
>   	    {
>   	      flag_abi_version = warn_abi_version;
> -	      id2 = mangle_decl_string (decl);
> -	      id2 = targetm.mangle_decl_assembler_name (decl, id2);
> +	      id2 = get_mangled_id (decl);
>   	    }
>   	  flag_abi_version = save_ver;
>   
>
  

Patch

diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index a04bc584586f28cb80d21b5c6d647416aa8843df..9bd684608b9e3378292cdb042184ba603b3d69aa 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -4503,8 +4503,7 @@  mangle_decl (const tree decl)
 	    return;
 
 	  flag_abi_version = flag_abi_compat_version;
-	  id2 = mangle_decl_string (decl);
-	  id2 = targetm.mangle_decl_assembler_name (decl, id2);
+	  id2 = get_mangled_id (decl);
 	  flag_abi_version = save_ver;
 
 	  if (id2 != id)
@@ -4519,8 +4518,7 @@  mangle_decl (const tree decl)
 	      || id2 == NULL_TREE)
 	    {
 	      flag_abi_version = warn_abi_version;
-	      id2 = mangle_decl_string (decl);
-	      id2 = targetm.mangle_decl_assembler_name (decl, id2);
+	      id2 = get_mangled_id (decl);
 	    }
 	  flag_abi_version = save_ver;