Diff of /Backend/If1opt/callreorder.c [32eb06] .. [28e18d] Maximize Restore

  Switch to side-by-side view

--- a/Backend/If1opt/callreorder.c
+++ b/Backend/If1opt/callreorder.c
@@ -1,3 +1,15 @@
+/**************************************************************************/
+/* FILE   **************       callreorder.c       ************************/
+/**************************************************************************/
+/* Author: Dave Cann                                                      */
+/* Update: Patrick Miller -- Ansi support (Dec 2000)                      */
+/* Copyright (C) University of California Regents                         */
+/**************************************************************************/
+/*
+ * $Log:
+ */
+/**************************************************************************/
+
 #include "world.h"
 
 PNODE SortedTree;
@@ -40,7 +52,7 @@
   for ( n = g->G_NODES; n != NULL; n = n->nsucc ) {
     if ( IsCompound( n ) ) {
       for ( sg = n->C_SUBS; sg != NULL; sg = sg->gsucc ) {
-	if ( !InSortedTree( f,sg ) ) return FALSE;
+        if ( !InSortedTree( f,sg ) ) return FALSE;
       }
     }
 
@@ -62,15 +74,15 @@
   for ( n = g->G_NODES; n != NULL; n = n->nsucc ) {
     if ( IsCompound( n ) ) {
       for (sg = n->C_SUBS; sg != NULL; sg = sg->gsucc) {
-	if (CallReachable(f,sg)) return TRUE;
+        if (CallReachable(f,sg)) return TRUE;
       }
     }
 
     if ( IsCall(n) ) {
       ff = FindTheFunction(n->imp->CoNsT);
       if ( !ff->checked ) {
-	ff->checked = TRUE;
-	if (ff==f || CallReachable(f,ff)) return TRUE;
+        ff->checked = TRUE;
+        if (ff==f || CallReachable(f,ff)) return TRUE;
       }
     }
   }
@@ -79,17 +91,17 @@
 }
 
 static int InRecursiveChain(F)
-     PNODE	F;
+     PNODE      F;
 {
-  PNODE		ff;
+  PNODE         ff;
 
   /* ------------------------------------------------------------ */
-  /* Set all uncommitted functions as unmarked			  */
+  /* Set all uncommitted functions as unmarked                    */
   /* ------------------------------------------------------------ */
   for(ff=glstop->gsucc; ff; ff=ff->gsucc) ff->checked = FALSE;
 
   /* ------------------------------------------------------------ */
-  /* Look for a cycle that contains F				  */
+  /* Look for a cycle that contains F                             */
   /* ------------------------------------------------------------ */
   return CallReachable(F,F);
 }
@@ -101,7 +113,7 @@
 /**************************************************************************/
 void CallReorder()
 {
-  register PNODE	f,next,last;
+  register PNODE        f,next,last;
 
   SortedTree = NULL;
 
@@ -109,24 +121,24 @@
     for ( f = glstop->gsucc; f; f = next ) {
       next = f->gsucc;
       if ( InSortedTree(f,f) || InRecursiveChain(f) ) {
-	/* ------------------------------------------------------------ */
-	/* Unlink node from glstop list					*/
-	/* ------------------------------------------------------------ */
-	f->gpred->gsucc = next;
-	if ( next ) next->gpred = f->gpred;
+        /* ------------------------------------------------------------ */
+        /* Unlink node from glstop list                                 */
+        /* ------------------------------------------------------------ */
+        f->gpred->gsucc = next;
+        if ( next ) next->gpred = f->gpred;
 
-	/* ------------------------------------------------------------ */
-	/* Add it to SortedTree list					*/
-	/* ------------------------------------------------------------ */
-	f->gsucc = SortedTree;
-	SortedTree = f;
-	f->checked = TRUE;	/* Helps speed up InRecursiveChain */
+        /* ------------------------------------------------------------ */
+        /* Add it to SortedTree list                                    */
+        /* ------------------------------------------------------------ */
+        f->gsucc = SortedTree;
+        SortedTree = f;
+        f->checked = TRUE;      /* Helps speed up InRecursiveChain */
       }
     }
   }
 
   /* ------------------------------------------------------------ */
-  /* Relink the sorted calls onto the glstop list		  */
+  /* Relink the sorted calls onto the glstop list                 */
   /* ------------------------------------------------------------ */
   glstop->gpred = SortedTree;
   last = (PNODE)NULL;
@@ -144,8 +156,33 @@
 }
 
 /* $Log$
-/* Revision 1.1  2000/12/31 17:56:10  patmiller
-/* Initial revision
+/* Revision 1.2  2001/01/01 05:46:22  patmiller
+/* Adding prototypes and header info -- all will be broken
+/*
+/* Revision 1.1.1.1  2000/12/31 17:56:10  patmiller
+/* Well, here is the first set of big changes in the distribution
+/* in 5 years!  Right now, I did a lot of work on configuration/
+/* setup (now all autoconf), breaking out the machine dependent
+/* #ifdef's (with a central acconfig.h driven config file), changed
+/* the installation directories to be more gnu style /usr/local
+/* (putting data in the /share/sisal14 dir for instance), and
+/* reduced the footprint in the top level /usr/local/xxx hierarchy.
+/*
+/* I also wrote a new compiler tool (sisalc) to replace osc.  I
+/* found that the old logic was too convoluted.  This does NOT
+/* replace the full functionality, but then again, it doesn't have
+/* 300 options on it either.
+/*
+/* Big change is making the code more portably correct.  It now
+/* compiles under gcc -ansi -Wall mostly.  Some functions are
+/* not prototyped yet.
+/*
+/* Next up: Full prototypes (little) checking out the old FLI (medium)
+/* and a new Frontend for simpler extension and a new FLI (with clean
+/* C, C++, F77, and Python! support).
+/*
+/* Pat
+/*
 /*
  * Revision 1.2  1994/04/15  15:50:29  denton
  * Added config.h to centralize machine specific header files.