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] Inline streamer_tree_cache_get


Not doing that appearantly keeps us avoiding this abstraction
in most places.  All asserts in its implementation are overzealous
as well as VEC already has all required checking.

Committed as obvious (LTO bootstrap is broken for other reasons
right now).

Richard.

2012-10-09  Richard Guenther  <rguenther@suse.de>

	* tree-streamer.c (streamer_tree_cache_get): Move ...
	* tree-streamer.h (streamer_tree_cache_get): ... here as inline.

Index: gcc/tree-streamer.c
===================================================================
*** gcc/tree-streamer.c	(revision 192247)
--- gcc/tree-streamer.c	(working copy)
*************** streamer_tree_cache_lookup (struct strea
*** 232,251 ****
  }
  
  
- /* Return the tree node at slot IX in CACHE.  */
- 
- tree
- streamer_tree_cache_get (struct streamer_tree_cache_d *cache, unsigned ix)
- {
-   gcc_assert (cache);
- 
-   /* Make sure we're not requesting something we don't have.  */
-   gcc_assert (ix < VEC_length (tree, cache->nodes));
- 
-   return VEC_index (tree, cache->nodes, ix);
- }
- 
- 
  /* Record NODE in CACHE.  */
  
  static void
--- 232,237 ----
Index: gcc/tree-streamer.h
===================================================================
*** gcc/tree-streamer.h	(revision 192247)
--- gcc/tree-streamer.h	(working copy)
*************** bool streamer_tree_cache_insert_at (stru
*** 93,100 ****
  void streamer_tree_cache_append (struct streamer_tree_cache_d *, tree);
  bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
  				 unsigned *);
- tree streamer_tree_cache_get (struct streamer_tree_cache_d *, unsigned);
  struct streamer_tree_cache_d *streamer_tree_cache_create (void);
  void streamer_tree_cache_delete (struct streamer_tree_cache_d *);
  
  #endif  /* GCC_TREE_STREAMER_H  */
--- 93,108 ----
  void streamer_tree_cache_append (struct streamer_tree_cache_d *, tree);
  bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree,
  				 unsigned *);
  struct streamer_tree_cache_d *streamer_tree_cache_create (void);
  void streamer_tree_cache_delete (struct streamer_tree_cache_d *);
  
+ /* Return the tree node at slot IX in CACHE.  */
+ 
+ static inline tree
+ streamer_tree_cache_get (struct streamer_tree_cache_d *cache, unsigned ix)
+ {
+   return VEC_index (tree, cache->nodes, ix);
+ }
+ 
+ 
  #endif  /* GCC_TREE_STREAMER_H  */


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