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] Cleanup the final_scan_insn function


Hello.

  This patch change the code:
  if (! app_on)
    {
      fputs (ASM_APP_ON, file);
      app_on = 1;
    }
  on call the app_enable() function and the code:
  if (app_on)
    {
      fputs (ASM_APP_OFF, file);
      app_on = 0;
    }
  on call the app_disable() function, which do the same.

  Patch was bootstrapped and regression tested on x86_64-unknown-linux-gnu.

  Ok to commit?

2008-08-07  Anatoly Sokolov  <aesok@post.ru>

        * gcc/final.c (final_scan_insn): Use app_enable/app_disable functions.

Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 138816)
+++ gcc/final.c	(working copy)
@@ -2007,11 +2007,7 @@
       if (LABEL_NAME (insn))
        (*debug_hooks->label) (insn);
 
-      if (app_on)
-       {
-         fputs (ASM_APP_OFF, file);
-         app_on = 0;
-       }
+      app_disable ();
 
       next = next_nonnote_insn (insn);
       if (next != 0 && JUMP_P (next))
@@ -2111,11 +2107,7 @@
            else
              switch_to_section (current_function_section ());
 
-           if (app_on)
-             {
-               fputs (ASM_APP_OFF, file);
-               app_on = 0;
-             }
+           app_disable ();
 
 #if defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC)
            if (GET_CODE (body) == ADDR_VEC)
@@ -2189,11 +2181,7 @@
              {
                expanded_location loc;
 
-               if (! app_on)
-                 {
-                   fputs (ASM_APP_ON, file);
-                   app_on = 1;
-                 }
+               app_enable ();
                loc = expand_location (ASM_INPUT_SOURCE_LOCATION (body));
                if (*loc.file && loc.line)
                  fprintf (asm_out_file, "%s %i \"%s\" 1\n",
@@ -2233,11 +2221,7 @@
            /* Output the insn using them.  */
            if (string[0])
              {
-               if (! app_on)
-                 {
-                   fputs (ASM_APP_ON, file);
-                   app_on = 1;
-                 }
+               app_enable ();
                if (expanded.file && expanded.line)
                  fprintf (asm_out_file, "%s %i \"%s\" 1\n",
                           ASM_COMMENT_START, expanded.line, expanded.file);
@@ -2252,11 +2236,7 @@
            break;
          }
 
-       if (app_on)
-         {
-           fputs (ASM_APP_OFF, file);
-           app_on = 0;
-         }
+       app_disable ();
 
        if (GET_CODE (body) == SEQUENCE)
          {


Anatoliy.


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