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]

Handle -fsched-verbose more elegantly


Hi,

With the new option handling we can ask the option
parsers to extract the integer argument, so there is
no need for haifa to do so itself.

Bootstrapped and tested on x86_64-suse-linux-gnu, and
tested -fsched-verbose to make sure it still works.
OK?

Gr.
Steven

	* common.opt (fsched-verbose): Force only unsigned integers as
	valid argument.
	* haifa-sched.c (fix_sched_param): Remove.
	(sched_set_verbose_param): New function to replace it.  Set the
	verbosity level.
	* opts.c (common_handle_option): Use it.
	* rtl.h (fix_sched_param): Remove prototype for this and...
	(sched_set_verbose_param): add a prototype for its successor.

Index: common.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/common.opt,v
retrieving revision 1.39
diff -c -3 -p -r1.39 common.opt
*** common.opt	30 Jun 2004 21:28:59 -0000	1.39
--- common.opt	1 Jul 2004 09:47:19 -0000
*************** Common Report Var(flag_schedule_speculat
*** 639,645 ****
  Allow speculative motion of more loads
  
  fsched-verbose=
! Common RejectNegative Joined
  -fsched-verbose=<number>	Set the verbosity level of the scheduler
  
  fsched2-use-superblocks
--- 639,645 ----
  Allow speculative motion of more loads
  
  fsched-verbose=
! Common RejectNegative Joined UInteger
  -fsched-verbose=<number>	Set the verbosity level of the scheduler
  
  fsched2-use-superblocks
Index: haifa-sched.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/haifa-sched.c,v
retrieving revision 1.246
diff -c -3 -p -r1.246 haifa-sched.c
*** haifa-sched.c	30 Jun 2004 18:17:53 -0000	1.246
--- haifa-sched.c	1 Jul 2004 09:47:19 -0000
*************** FILE *sched_dump = 0;
*** 184,199 ****
  /* Highest uid before scheduling.  */
  static int old_max_uid;
  
! /* fix_sched_param() is called from toplev.c upon detection
!    of the -fsched-verbose=N option.  */
  
  void
! fix_sched_param (const char *param, const char *val)
  {
!   if (!strcmp (param, "verbose"))
!     sched_verbose_param = atoi (val);
!   else
!     warning ("fix_sched_param: unknown param: %s", param);
  }
  
  struct haifa_insn_data *h_i_d;
--- 184,195 ----
  /* Highest uid before scheduling.  */
  static int old_max_uid;
  
! /* Called from opts.c upon detection of the -fsched-verbose=N option.  */
  
  void
! sched_set_verbose_param (int val)
  {
!   sched_verbose_param = val;
  }
  
  struct haifa_insn_data *h_i_d;
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.71
diff -c -3 -p -r1.71 opts.c
*** opts.c	29 Jun 2004 01:53:02 -0000	1.71
--- opts.c	1 Jul 2004 09:47:19 -0000
*************** common_handle_option (size_t scode, cons
*** 843,849 ****
  
      case OPT_fsched_verbose_:
  #ifdef INSN_SCHEDULING
!       fix_sched_param ("verbose", arg);
        break;
  #else
        return 0;
--- 843,849 ----
  
      case OPT_fsched_verbose_:
  #ifdef INSN_SCHEDULING
!       sched_set_verbose_param (value);
        break;
  #else
        return 0;
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.484
diff -c -3 -p -r1.484 rtl.h
*** rtl.h	1 Jul 2004 08:23:29 -0000	1.484
--- rtl.h	1 Jul 2004 09:47:20 -0000
*************** extern void schedule_ebbs (FILE *);
*** 2250,2256 ****
  #endif
  
  /* In haifa-sched.c.  */
! extern void fix_sched_param (const char *, const char *);
  
  /* In print-rtl.c */
  extern const char *print_rtx_head;
--- 2250,2256 ----
  #endif
  
  /* In haifa-sched.c.  */
! extern void sched_set_verbose_param (int);
  
  /* In print-rtl.c */
  extern const char *print_rtx_head;


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