[phc-internals] [phc] r3397 committed - Remove the flag for missed optimizations. We don't use it.

phc at googlecode.com phc at googlecode.com
Sun Oct 31 23:37:26 GMT 2010


Revision: 3397
Author: paul.biggar
Date: Sun Oct 31 16:36:44 2010
Log: Remove the flag for missed optimizations. We don't use it.

http://code.google.com/p/phc/source/detail?r=3397

Modified:
  /trunk/src/generated/cmdline.c
  /trunk/src/generated/cmdline.h
  /trunk/src/generated_src/phc.ggo
  /trunk/src/lib/error.cpp
  /trunk/src/lib/error.h

=======================================
--- /trunk/src/generated/cmdline.c	Sat Aug 21 08:58:00 2010
+++ /trunk/src/generated/cmdline.c	Sun Oct 31 16:36:44 2010
@@ -93,7 +93,6 @@
    "      --cfg-dump=PASSNAME       Dump CFG after the pass  
named 'PASSNAME'",
    "      --debug=PASSNAME          Print debugging information for the  
pass named \n                                  'PASSNAME",
    "      --dont-fail               Dont fail on error (after parsing)   
\n                                  (default=off)",
-  "      --missed-opt              Give a warning when an optimization was  
missed  \n                                  (default=on)",
    "      --disable=PASSNAME        Disable the pass named 'PASSNAME'",
    "      --pause                   Pause compilation at pause() statements  
(in phc \n                                  source, not user code)   
(default=off)",
    "\nMore options are available via --full-help",
@@ -143,7 +142,7 @@
    gengetopt_args_info_help[37] = gengetopt_args_info_full_help[52];
    gengetopt_args_info_help[38] = gengetopt_args_info_full_help[53];
    gengetopt_args_info_help[39] = gengetopt_args_info_full_help[54];
-  gengetopt_args_info_help[40] = gengetopt_args_info_full_help[64];
+  gengetopt_args_info_help[40] = gengetopt_args_info_full_help[63];
    gengetopt_args_info_help[41] = 0;

  }
@@ -228,7 +227,6 @@
    args_info->cfg_dump_given = 0 ;
    args_info->debug_given = 0 ;
    args_info->dont_fail_given = 0 ;
-  args_info->missed_opt_given = 0 ;
    args_info->disable_given = 0 ;
    args_info->pause_given = 0 ;
  }
@@ -304,7 +302,6 @@
    args_info->debug_arg = NULL;
    args_info->debug_orig = NULL;
    args_info->dont_fail_flag = 0;
-  args_info->missed_opt_flag = 1;
    args_info->disable_arg = NULL;
    args_info->disable_orig = NULL;
    args_info->pause_flag = 0;
@@ -385,11 +382,10 @@
    args_info->debug_min = 0;
    args_info->debug_max = 0;
    args_info->dont_fail_help = gengetopt_args_info_full_help[60] ;
-  args_info->missed_opt_help = gengetopt_args_info_full_help[61] ;
-  args_info->disable_help = gengetopt_args_info_full_help[62] ;
+  args_info->disable_help = gengetopt_args_info_full_help[61] ;
    args_info->disable_min = 0;
    args_info->disable_max = 0;
-  args_info->pause_help = gengetopt_args_info_full_help[63] ;
+  args_info->pause_help = gengetopt_args_info_full_help[62] ;

  }

@@ -732,8 +728,6 @@
    write_multiple_into_file(outfile, args_info->debug_given, "debug",  
args_info->debug_orig, 0);
    if (args_info->dont_fail_given)
      write_into_file(outfile, "dont-fail", 0, 0 );
-  if (args_info->missed_opt_given)
-    write_into_file(outfile, "missed-opt", 0, 0 );
    write_multiple_into_file(outfile, args_info->disable_given, "disable",  
args_info->disable_orig, 0);
    if (args_info->pause_given)
      write_into_file(outfile, "pause", 0, 0 );
@@ -1395,7 +1389,6 @@
          { "cfg-dump",	1, NULL, 0 },
          { "debug",	1, NULL, 0 },
          { "dont-fail",	0, NULL, 0 },
-        { "missed-opt",	0, NULL, 0 },
          { "disable",	1, NULL, 0 },
          { "pause",	0, NULL, 0 },
          { 0,  0, 0, 0 }
@@ -1998,18 +1991,6 @@
                goto failure;

            }
-          /* Give a warning when an optimization was missed.  */
-          else if (strcmp (long_options[option_index].name, "missed-opt")  
== 0)
-          {
-
-
-            if (update_arg((void *)&(args_info->missed_opt_flag), 0,  
&(args_info->missed_opt_given),
-                &(local_args_info.missed_opt_given), optarg, 0, 0,  
ARG_FLAG,
-                check_ambiguity, override, 1, 0, "missed-opt", '-',
-                additional_error))
-              goto failure;
-
-          }
            /* Disable the pass named 'PASSNAME'.  */
            else if (strcmp (long_options[option_index].name, "disable") ==  
0)
            {
=======================================
--- /trunk/src/generated/cmdline.h	Sat Aug 21 08:58:00 2010
+++ /trunk/src/generated/cmdline.h	Sun Oct 31 16:36:44 2010
@@ -179,8 +179,6 @@
    const char *debug_help; /**< @brief Print debugging information for the  
pass named 'PASSNAME help description.  */
    int dont_fail_flag;	/**< @brief Dont fail on error (after parsing)  
(default=off).  */
    const char *dont_fail_help; /**< @brief Dont fail on error (after  
parsing) help description.  */
-  int missed_opt_flag;	/**< @brief Give a warning when an optimization was  
missed (default=on).  */
-  const char *missed_opt_help; /**< @brief Give a warning when an  
optimization was missed help description.  */
    char ** disable_arg;	/**< @brief Disable the pass named 'PASSNAME'.  */
    char ** disable_orig;	/**< @brief Disable the pass named 'PASSNAME'  
original value given at command line.  */
    unsigned int disable_min; /**< @brief Disable the pass  
named 'PASSNAME''s minimum occurreces */
@@ -240,7 +238,6 @@
    unsigned int cfg_dump_given ;	/**< @brief Whether cfg-dump was given.  */
    unsigned int debug_given ;	/**< @brief Whether debug was given.  */
    unsigned int dont_fail_given ;	/**< @brief Whether dont-fail was given.   
*/
-  unsigned int missed_opt_given ;	/**< @brief Whether missed-opt was  
given.  */
    unsigned int disable_given ;	/**< @brief Whether disable was given.  */
    unsigned int pause_given ;	/**< @brief Whether pause was given.  */

=======================================
--- /trunk/src/generated_src/phc.ggo	Sat Aug 21 08:58:00 2010
+++ /trunk/src/generated_src/phc.ggo	Sun Oct 31 16:36:44 2010
@@ -67,7 +67,6 @@
  option "cfg-dump" - "Dump CFG after the pass named 'PASSNAME'" string  
typestr="PASSNAME" multiple hidden optional
  option "debug" - "Print debugging information for the pass  
named 'PASSNAME" string typestr="PASSNAME" multiple hidden optional
  option "dont-fail" - "Dont fail on error (after parsing)" flag off hidden
-option "missed-opt" - "Give a warning when an optimization was missed"  
flag on hidden # this should be off by default, obviously
  option "disable" - "Disable the pass named 'PASSNAME'" string  
typestr="PASSNAME" multiple hidden optional
  option "pause" - "Pause compilation at pause() statements (in phc source,  
not user code)" flag off hidden

=======================================
--- /trunk/src/lib/error.cpp	Thu Sep  3 10:14:18 2009
+++ /trunk/src/lib/error.cpp	Sun Oct 31 16:36:44 2010
@@ -27,13 +27,10 @@
  struct gengetopt_args_info error_args_info;

  enum Error_type { WARNING=0, ERROR=1, INTERNAL_ERROR=2, MISSED_OPT=3 };
-static const char* error_messages[] = { "Warning", "Error", "Internal  
error", "Missed optimization" };
+static const char* error_messages[] = { "Warning", "Error", "Internal  
error", };

  void phc_message (Error_type type, const char* message_template, String*  
filename, int line, int column, va_list argp)
  {
-	if (type == MISSED_OPT && !error_args_info.missed_opt_given)
-		return;
-
  	if (type == WARNING && error_args_info.no_warnings_flag)
  		return;

@@ -81,7 +78,6 @@
  define_explicit_message_func (internal_error, INTERNAL_ERROR);
  define_explicit_message_func (error, ERROR);
  define_explicit_message_func (warning, WARNING);
-define_explicit_message_func (missed_opt, MISSED_OPT);

  #define define_va_list_message_func(NAME, TYPE)					\
  void phc_##NAME (const char* message, va_list argp,			\
@@ -94,7 +90,6 @@
  define_va_list_message_func (internal_error, INTERNAL_ERROR);
  define_va_list_message_func (error, ERROR);
  define_va_list_message_func (warning, WARNING);
-define_va_list_message_func (missed_opt, MISSED_OPT);


  // No filename or line number
@@ -111,7 +106,6 @@
  define_null_message_func (internal_error, INTERNAL_ERROR);
  define_null_message_func (error, ERROR);
  define_null_message_func (warning, WARNING);
-define_null_message_func (missed_opt, MISSED_OPT);


  // Use the node to pass the name or line number
@@ -146,10 +140,6 @@
  define_node_message_func (internal_error, INTERNAL_ERROR, MIR::Node);
  define_node_message_func (internal_error, INTERNAL_ERROR, MICG::Node);

-define_node_message_func (missed_opt, MISSED_OPT, AST::Node);
-define_node_message_func (missed_opt, MISSED_OPT, HIR::Node);
-define_node_message_func (missed_opt, MISSED_OPT, MIR::Node);
-define_node_message_func (missed_opt, MISSED_OPT, MICG::Node);


  void _phc_optimization_exception (string message, string filename, int  
line)
=======================================
--- /trunk/src/lib/error.h	Tue Sep 21 13:32:29 2010
+++ /trunk/src/lib/error.h	Sun Oct 31 16:36:44 2010
@@ -51,14 +51,6 @@
  #define phc_unreachable() assert(0 && "Should be unreachable")
  #define phc_TODO() assert(0 && "TODO")

-void phc_missed_opt (const char* message, ...);
-void phc_missed_opt (const char* message, va_list args, String* filename,  
int line, int column);
-void phc_missed_opt (const char* message, String* filename, int line, int  
column, ...);
-void phc_missed_opt (const char* message, AST::Node*, ...);
-void phc_missed_opt (const char* message, HIR::Node*, ...);
-void phc_missed_opt (const char* message, MIR::Node*, ...);
-void phc_missed_opt (const char* message, MICG::Node*, ...);
-
  void _phc_optimization_exception (string message, string filename, int  
line);

  #define phc_optimization_exception(MSG)  
_phc_optimization_exception(MSG,__FILE__,__LINE__)


More information about the phc-internals mailing list