Re: [PATCH 2/4] Use const for some function arguments.

2020-05-05 Thread Jeff Law via Gcc-patches
On Tue, 2020-02-04 at 14:55 +0100, Martin Liska wrote:
> gcc/ChangeLog:
> 
> 2020-02-04  Martin Liska  
> 
>   PR c/92472.
>   * alloc-pool.h: Use const for some arguments.
>   * bitmap.h: Likewise.
>   * mem-stats.h: Likewise.
>   * sese.h (get_entry_bb): Likewise.
>   (get_exit_bb): Likewise.
OK.  And constification should be considered obvious and doesn't need a review
cycle.

jeff
> 



Re: [PATCH 2/4] Use const for some function arguments.

2020-02-17 Thread Richard Biener
On Mon, Feb 17, 2020 at 11:05 AM Martin Liška  wrote:
>
> On 2/7/20 6:21 PM, Segher Boessenkool wrote:
> > On Tue, Feb 04, 2020 at 02:55:14PM +0100, Martin Liska wrote:
> >>
> >> gcc/ChangeLog:
> >>
> >> 2020-02-04  Martin Liska  
> >>
> >>  PR c/92472.
> >
> > That trailing dot should not be there (in some other patches as well).
>
> Sure. I'll fix it.
>
> @Richi: May I install the patch once stage1 opens, or will it require
> another review?

Yes, OK for stage1.

> Martin
>
> >
> >
> > Segher
> >
>


Re: [PATCH 2/4] Use const for some function arguments.

2020-02-17 Thread Martin Liška

On 2/7/20 6:21 PM, Segher Boessenkool wrote:

On Tue, Feb 04, 2020 at 02:55:14PM +0100, Martin Liska wrote:


gcc/ChangeLog:

2020-02-04  Martin Liska  

PR c/92472.


That trailing dot should not be there (in some other patches as well).


Sure. I'll fix it.

@Richi: May I install the patch once stage1 opens, or will it require
another review?

Martin




Segher





Re: [PATCH 2/4] Use const for some function arguments.

2020-02-07 Thread Segher Boessenkool
On Tue, Feb 04, 2020 at 02:55:14PM +0100, Martin Liska wrote:
> 
> gcc/ChangeLog:
> 
> 2020-02-04  Martin Liska  
> 
>   PR c/92472.

That trailing dot should not be there (in some other patches as well).


Segher


[PATCH 2/4] Use const for some function arguments.

2020-02-06 Thread Martin Liska

gcc/ChangeLog:

2020-02-04  Martin Liska  

PR c/92472.
* alloc-pool.h: Use const for some arguments.
* bitmap.h: Likewise.
* mem-stats.h: Likewise.
* sese.h (get_entry_bb): Likewise.
(get_exit_bb): Likewise.
---
 gcc/alloc-pool.h | 2 +-
 gcc/bitmap.h | 2 +-
 gcc/mem-stats.h  | 4 ++--
 gcc/sese.h   | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h
index 1686a8b5f91..fd7194bfea4 100644
--- a/gcc/alloc-pool.h
+++ b/gcc/alloc-pool.h
@@ -60,7 +60,7 @@ public:
 
   /* Dump usage coupled to LOC location, where TOTAL is sum of all rows.  */
   inline void
-  dump (mem_location *loc, mem_usage &total) const
+  dump (mem_location *loc, const mem_usage &total) const
   {
 char *location_string = loc->to_string ();
 
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index d52fd5bb905..b481f4b2606 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -237,7 +237,7 @@ public:
 
   /* Dump usage coupled to LOC location, where TOTAL is sum of all rows.  */
   inline void
-  dump (mem_location *loc, mem_usage &total) const
+  dump (mem_location *loc, const mem_usage &total) const
   {
 char *location_string = loc->to_string ();
 
diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h
index 21d038bb370..4a3177dd4fc 100644
--- a/gcc/mem-stats.h
+++ b/gcc/mem-stats.h
@@ -70,7 +70,7 @@ public:
 
   /* Return true if the memory location is equal to OTHER.  */
   int
-  equal (mem_location &other)
+  equal (const mem_location &other)
   {
 return m_filename == other.m_filename && m_function == other.m_function
   && m_line == other.m_line;
@@ -203,7 +203,7 @@ public:
 
   /* Dump usage coupled to LOC location, where TOTAL is sum of all rows.  */
   inline void
-  dump (mem_location *loc, mem_usage &total) const
+  dump (mem_location *loc, const mem_usage &total) const
   {
 char *location_string = loc->to_string ();
 
diff --git a/gcc/sese.h b/gcc/sese.h
index 8afea28b07e..74d3fe3cd8a 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -45,7 +45,7 @@ void dump_sese (const sese_l &);
 /* Get the entry of an sese S.  */
 
 static inline basic_block
-get_entry_bb (sese_l &s)
+get_entry_bb (const sese_l &s)
 {
   return s.entry->dest;
 }
@@ -53,7 +53,7 @@ get_entry_bb (sese_l &s)
 /* Get the exit of an sese S.  */
 
 static inline basic_block
-get_exit_bb (sese_l &s)
+get_exit_bb (const sese_l &s)
 {
   return s.exit->src;
 }