This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/4] Fix GNU coding style.


gcc/ChangeLog:

2018-11-02  Martin Liska  <mliska@suse.cz>

	* mem-stats.h (mem_alloc_description::get_list): Fix GNU coding
	style.
	* vec.c: Likewise.
---
 gcc/mem-stats.h | 61 +++++++++++++++++++++----------------------------
 gcc/vec.c       |  1 -
 2 files changed, 26 insertions(+), 36 deletions(-)

diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h
index 140691e8ec1..3ef6d53dfa6 100644
--- a/gcc/mem-stats.h
+++ b/gcc/mem-stats.h
@@ -282,21 +282,21 @@ public:
     static hashval_t
     hash (value_type l)
     {
-	inchash::hash hstate;
+      inchash::hash hstate;
 
-	hstate.add_ptr ((const void *)l->m_filename);
-	hstate.add_ptr (l->m_function);
-	hstate.add_int (l->m_line);
+      hstate.add_ptr ((const void *)l->m_filename);
+      hstate.add_ptr (l->m_function);
+      hstate.add_int (l->m_line);
 
-	return hstate.end ();
+      return hstate.end ();
     }
 
     static bool
     equal (value_type l1, value_type l2)
     {
-      return l1->m_filename == l2->m_filename
-	&& l1->m_function == l2->m_function
-	&& l1->m_line == l2->m_line;
+      return (l1->m_filename == l2->m_filename
+	      && l1->m_function == l2->m_function
+	      && l1->m_line == l2->m_line);
     }
   };
 
@@ -313,59 +313,50 @@ public:
   ~mem_alloc_description ();
 
   /* Returns true if instance PTR is registered by the memory description.  */
-  bool
-  contains_descriptor_for_instance (const void *ptr);
+  bool contains_descriptor_for_instance (const void *ptr);
 
   /* Return descriptor for instance PTR.  */
-  T *
-  get_descriptor_for_instance (const void *ptr);
+  T * get_descriptor_for_instance (const void *ptr);
 
   /* Register memory allocation descriptor for container PTR which is
      described by a memory LOCATION.  */
-  T *
-  register_descriptor (const void *ptr, mem_location *location);
+  T * register_descriptor (const void *ptr, mem_location *location);
 
   /* Register memory allocation descriptor for container PTR.  ORIGIN identifies
      type of container and GGC identifes if the allocation is handled in GGC
      memory.  Each location is identified by file NAME, LINE in source code and
      FUNCTION name.  */
-  T *
-  register_descriptor (const void *ptr, mem_alloc_origin origin,
-			  bool ggc, const char *name, int line,
-			  const char *function);
+  T * register_descriptor (const void *ptr, mem_alloc_origin origin,
+			   bool ggc, const char *name, int line,
+			   const char *function);
 
   /* Register instance overhead identified by PTR pointer. Allocation takes
      SIZE bytes.  */
-  T *
-  register_instance_overhead (size_t size, const void *ptr);
+  T * register_instance_overhead (size_t size, const void *ptr);
 
   /* For containers (and GGC) where we want to track every instance object,
      we register allocation of SIZE bytes, identified by PTR pointer, belonging
      to USAGE descriptor.  */
-  void
-  register_object_overhead (T *usage, size_t size, const void *ptr);
+  void register_object_overhead (T *usage, size_t size, const void *ptr);
 
   /* Release PTR pointer of SIZE bytes. If REMOVE_FROM_MAP is set to true,
      remove the instance from reverse map.  */
-  void
-  release_instance_overhead (void *ptr, size_t size,
+  void release_instance_overhead (void *ptr, size_t size,
 				  bool remove_from_map = false);
 
   /* Release intance object identified by PTR pointer.  */
-  void
-  release_object_overhead (void *ptr);
+  void release_object_overhead (void *ptr);
 
   /* Get sum value for ORIGIN type of allocation for the descriptor.  */
-  T
-  get_sum (mem_alloc_origin origin);
+  T get_sum (mem_alloc_origin origin);
 
   /* Get all tracked instances registered by the description. Items
      are filtered by ORIGIN type, LENGTH is return value where we register
      the number of elements in the list. If we want to process custom order,
      CMP comparator can be provided.  */
-  mem_list_t *
-  get_list (mem_alloc_origin origin, unsigned *length,
-	    int (*cmp) (const void *first, const void *second) = NULL);
+  mem_list_t * get_list (mem_alloc_origin origin, unsigned *length,
+			 int (*cmp) (const void *first,
+				     const void *second) = NULL);
 
   /* Dump all tracked instances of type ORIGIN. If we want to process custom
      order, CMP comparator can be provided.  */
@@ -391,7 +382,6 @@ private:
   reverse_mem_map_t *m_reverse_map;
 };
 
-
 /* Returns true if instance PTR is registered by the memory description.  */
 
 template <class T>
@@ -410,9 +400,9 @@ mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr)
   return m_reverse_map->get (ptr) ? (*m_reverse_map->get (ptr)).usage : NULL;
 }
 
+/* Register memory allocation descriptor for container PTR which is
+   described by a memory LOCATION.  */
 
-  /* Register memory allocation descriptor for container PTR which is
-     described by a memory LOCATION.  */
 template <class T>
 inline T*
 mem_alloc_description<T>::register_descriptor (const void *ptr,
@@ -584,7 +574,8 @@ template <class T>
 inline
 typename mem_alloc_description<T>::mem_list_t *
 mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length,
-			int (*cmp) (const void *first, const void *second))
+				    int (*cmp) (const void *first,
+						const void *second))
 {
   /* vec data structure is not used because all vectors generate memory
      allocation info a it would create a cycle.  */
diff --git a/gcc/vec.c b/gcc/vec.c
index ac3226b5fcb..ff2456aead9 100644
--- a/gcc/vec.c
+++ b/gcc/vec.c
@@ -141,7 +141,6 @@ vec_prefix::release_overhead (void *ptr, size_t size, bool in_dtor
   vec_mem_desc.release_instance_overhead (ptr, size, in_dtor);
 }
 
-
 /* Calculate the number of slots to reserve a vector, making sure that
    it is of at least DESIRED size by growing ALLOC exponentially.  */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]