Thank you for the review Andi.

Yes, the corresponding reader change is

@@ -15671,8 +15673,9 @@ module_state::read_location (bytes_in &sec) const
        if (range.m_start == UNKNOWN_LOCATION)
          range.m_start = locus;
        range.m_finish = read_location (sec);
+       unsigned discriminator = sec.u ();
        if (locus != loc && range.m_start != loc && range.m_finish != loc)
-         locus = get_combined_adhoc_loc (line_table, locus, range, NULL);
+         locus = get_combined_adhoc_loc (line_table, locus, range, NULL, 
discriminator);
       }
       break;

-----Original Message-----
From: Andi Kleen <a...@linux.intel.com> 
Sent: Sunday, June 12, 2022 4:53 PM
To: Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Jan Hubicka <hubi...@ucw.cz>; Eugene Rozenfeld 
<eugene.rozenf...@microsoft.com>
Subject: [EXTERNAL] Re: [PATCH] Add instruction level discriminator support.

Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>      {
> diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 
> d1dc73724d1..5ed6b7b0f94 100644
> --- a/gcc/cp/module.cc
> +++ b/gcc/cp/module.cc
> @@ -15587,6 +15587,8 @@ module_state::write_location (bytes_out &sec, 
> location_t loc)
>       range.m_start = UNKNOWN_LOCATION;
>        write_location (sec, range.m_start);
>        write_location (sec, range.m_finish);
> +      unsigned discriminator = get_discriminator_from_adhoc_loc (line_table, 
> loc);
> +      sec.u (discriminator);

I hope this has a corresponding reader change, wasn't fully clear. Should it 
use some common function?

The patch looks good to me, but I cannot approve.

-Andi

Reply via email to