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] Make a few functions static


These functions are called from one file only (and have been so
since at least 3.2).  Just a small cleanup.

Palo

2004-02-18  Paolo Bonzini <bonzini@gnu.org>

	* cse.c (cse_end_of_basic_block): Make static.
	* local-alloc.c (function_invariant_p): Move to
	reload1.c.
	* loop.c (libcall_other_reg, record_excess_regs):
	Make static.
	* reload1.c (function_invariant_p): Moved here
	from local-alloc.c, made static.
	* rtl.h (cse_end_of_basic_block, function_invariant_p,
	libcall_other_reg, record_excess_regs): Remove
	declarations.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.286
diff -u -r1.286 cse.c
--- cse.c	8 Feb 2004 19:45:46 -0000	1.286
+++ cse.c	10 Feb 2004 11:51:40 -0000
@@ -639,6 +639,8 @@
 static void record_jump_cond (enum rtx_code, enum machine_mode, rtx, rtx,
 			      int);
 static void cse_insn (rtx, rtx);
+static void cse_end_of_basic_block (rtx, struct cse_basic_block_data *,
+				    int, int, int);
 static int addr_affects_sp_p (rtx);
 static void invalidate_from_clobbers (rtx);
 static rtx cse_process_notes (rtx, rtx);
@@ -6750,7 +6752,7 @@
    the current block.  The incoming structure's branch path, if any, is used
    to construct the output branch path.  */
 
-void
+static void
 cse_end_of_basic_block (rtx insn, struct cse_basic_block_data *data,
 			int follow_jumps, int after_loop, int skip_blocks)
 {
Index: local-alloc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/local-alloc.c,v
retrieving revision 1.128
diff -u -r1.128 local-alloc.c
--- local-alloc.c	2 Feb 2004 00:17:17 -0000	1.128
+++ local-alloc.c	10 Feb 2004 11:51:43 -0000
@@ -759,27 +759,6 @@
   return 0;
 }
 
-/* Return nonzero if the rtx X is invariant over the current function.  */
-/* ??? Actually, the places this is used in reload expect exactly what
-   is tested here, and not everything that is function invariant.  In
-   particular, the frame pointer and arg pointer are special cased;
-   pic_offset_table_rtx is not, and this will cause aborts when we
-   go to spill these things to memory.  */
-
-int
-function_invariant_p (rtx x)
-{
-  if (CONSTANT_P (x))
-    return 1;
-  if (x == frame_pointer_rtx || x == arg_pointer_rtx)
-    return 1;
-  if (GET_CODE (x) == PLUS
-      && (XEXP (x, 0) == frame_pointer_rtx || XEXP (x, 0) == arg_pointer_rtx)
-      && CONSTANT_P (XEXP (x, 1)))
-    return 1;
-  return 0;
-}
-
 /* Find registers that are equivalent to a single value throughout the
    compilation (either because they can be referenced in memory or are set once
    from a single constant).  Lower their priority for a register.
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.491
diff -u -r1.491 loop.c
--- loop.c	6 Feb 2004 20:10:35 -0000	1.491
+++ loop.c	10 Feb 2004 11:51:45 -0000
@@ -263,6 +263,8 @@
 #endif
 static rtx skip_consec_insns (rtx, int);
 static int libcall_benefit (rtx);
+static rtx libcall_other_reg (rtx, rtx);
+static void record_excess_regs (rtx, rtx, rtx *);
 static void ignore_some_movables (struct loop_movables *);
 static void force_movables (struct loop_movables *);
 static void combine_movables (struct loop_movables *, struct loop_regs *);
@@ -1231,7 +1233,7 @@
 /* Add elements to *OUTPUT to record all the pseudo-regs
    mentioned in IN_THIS but not mentioned in NOT_IN_THIS.  */
 
-void
+static void
 record_excess_regs (rtx in_this, rtx not_in_this, rtx *output)
 {
   enum rtx_code code;
@@ -1285,7 +1287,7 @@
    If there are none, return 0.
    If there are one or more, return an EXPR_LIST containing all of them.  */
 
-rtx
+static rtx
 libcall_other_reg (rtx insn, rtx equiv)
 {
   rtx note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.427
diff -u -r1.427 reload1.c
--- reload1.c	6 Feb 2004 22:10:22 -0000	1.427
+++ reload1.c	10 Feb 2004 11:51:47 -0000
@@ -402,6 +402,7 @@
 					rtx, rtx, int, int);
 static int free_for_value_p (int, enum machine_mode, int, enum reload_type,
 			     rtx, rtx, int, int);
+static int function_invariant_p (rtx);
 static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type);
 static int allocate_reload_reg (struct insn_chain *, int, int);
 static int conflicts_with_override (rtx);
@@ -4971,6 +4972,27 @@
 				       ignore_address_reloads))
       return 0;
   return 1;
+}
+
+/* Return nonzero if the rtx X is invariant over the current function.  */
+/* ??? Actually, the places where we use this expect exactly what
+ * is tested here, and not everything that is function invariant.  In
+ * particular, the frame pointer and arg pointer are special cased;
+ * pic_offset_table_rtx is not, and this will cause aborts when we
+ *             go to spill these things to memory.  */
+
+int
+function_invariant_p (rtx x)
+{
+  if (CONSTANT_P (x))
+    return 1;
+  if (x == frame_pointer_rtx || x == arg_pointer_rtx)
+    return 1;
+  if (GET_CODE (x) == PLUS
+      && (XEXP (x, 0) == frame_pointer_rtx || XEXP (x, 0) == arg_pointer_rtx)
+      && CONSTANT_P (XEXP (x, 1)))
+    return 1;
+  return 0;
 }
 
 /* Determine whether the reload reg X overlaps any rtx'es used for
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.456
diff -u -r1.456 rtl.h
--- rtl.h	10 Feb 2004 11:38:12 -0000	1.456
+++ rtl.h	10 Feb 2004 11:51:47 -0000
@@ -2002,8 +2004,6 @@
 extern int rtx_to_tree_code (enum rtx_code);

 /* In cse.c */
-struct cse_basic_block_data;
-
 /* Return the right cost to give to an operation
    to make the cost of the corresponding register-to-register instruction
    N times that of a fast register-to-register instruction.  */
@@ -2019,8 +2017,6 @@
 #ifdef BUFSIZ
 extern int cse_main (rtx, int, int, FILE *);
 #endif
-extern void cse_end_of_basic_block (rtx, struct cse_basic_block_data *,
-				    int, int, int);
 extern void cse_condition_code_reg (void);
 
 /* In jump.c */
@@ -2143,12 +2139,10 @@
 
 /* In loop.c */
 extern void init_loop (void);
-extern rtx libcall_other_reg (rtx, rtx);
 #ifdef BUFSIZ
 extern void loop_optimize (rtx, FILE *, int);
 #endif
 extern void branch_target_load_optimize (rtx, bool);
-extern void record_excess_regs (rtx, rtx, rtx *);
 
 /* In function.c */
 extern void reposition_prologue_and_epilogue_notes (rtx);
@@ -2241,7 +2241,6 @@
 extern void dump_local_alloc (FILE *);
 #endif
 extern int local_alloc (void);
-extern int function_invariant_p (rtx);
 
 /* In profile.c */
 extern void init_branch_prob (void);


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