* gnu-v3-abi.c (gnuv3_decode_method_ptr): New function.
[binutils-gdb.git] / gprof / cg_arcs.c
index f663954437998272b25a0611770ac6c89c9a1178..10f3f973ab09bbbfcfdb64bcbf539fdacc2f2350 100644 (file)
@@ -1,23 +1,33 @@
 /*
- * Copyright (c) 1983, 2001 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993, 2001
+ *      The Regents of the University of California.  All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement:  ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
-#include "libiberty.h"
 #include "gprof.h"
+#include "libiberty.h"
 #include "search_list.h"
 #include "source.h"
 #include "symtab.h"
 #include "utils.h"
 #include "sym_ids.h"
 
-static int cmp_topo PARAMS ((const PTR, const PTR));
-static void propagate_time PARAMS ((Sym *));
-static void cycle_time PARAMS ((void));
-static void cycle_link PARAMS ((void));
-static void inherit_flags PARAMS ((Sym *));
-static void propagate_flags PARAMS ((Sym **));
-static int cmp_total PARAMS ((const PTR, const PTR));
+static int cmp_topo (const PTR, const PTR);
+static void propagate_time (Sym *);
+static void cycle_time (void);
+static void cycle_link (void);
+static void inherit_flags (Sym *);
+static void propagate_flags (Sym **);
+static int cmp_total (const PTR, const PTR);
 
 Sym *cycle_header;
 unsigned int num_cycles;
@@ -46,9 +56,7 @@ unsigned int numarcs;
  * range covered by CHILD.
  */
 Arc *
-arc_lookup (parent, child)
-     Sym *parent;
-     Sym *child;
+arc_lookup (Sym *parent, Sym *child)
 {
   Arc *arc;
 
@@ -77,10 +85,7 @@ arc_lookup (parent, child)
  * Add (or just increment) an arc:
  */
 void
-arc_add (parent, child, count)
-     Sym *parent;
-     Sym *child;
-     unsigned long count;
+arc_add (Sym *parent, Sym *child, unsigned long count)
 {
   static unsigned int maxarcs = 0;
   Arc *arc, **newarcs;
@@ -146,9 +151,7 @@ arc_add (parent, child, count)
 
 
 static int
-cmp_topo (lp, rp)
-     const PTR lp;
-     const PTR rp;
+cmp_topo (const PTR lp, const PTR rp)
 {
   const Sym *left = *(const Sym **) lp;
   const Sym *right = *(const Sym **) rp;
@@ -158,8 +161,7 @@ cmp_topo (lp, rp)
 
 
 static void
-propagate_time (parent)
-     Sym *parent;
+propagate_time (Sym *parent)
 {
   Arc *arc;
   Sym *child;
@@ -306,7 +308,7 @@ cycle_link ()
       ++num;
       ++cyc;
       sym_init (cyc);
-      cyc->cg.print_flag = true;       /* should this be printed? */
+      cyc->cg.print_flag = TRUE;       /* should this be printed? */
       cyc->cg.top_order = DFN_NAN;     /* graph call chain top-sort order */
       cyc->cg.cyc.num = num;   /* internal number of cycle on */
       cyc->cg.cyc.head = cyc;  /* pointer to head of cycle */
@@ -355,8 +357,7 @@ cycle_link ()
  * fractions from parents.
  */
 static void
-inherit_flags (child)
-     Sym *child;
+inherit_flags (Sym *child)
 {
   Sym *head, *parent, *member;
   Arc *arc;
@@ -365,7 +366,7 @@ inherit_flags (child)
   if (child == head)
     {
       /* just a regular child, check its parents: */
-      child->cg.print_flag = false;
+      child->cg.print_flag = FALSE;
       child->cg.prop.fract = 0.0;
       for (arc = child->cg.parents; arc; arc = arc->next_parent)
        {
@@ -393,7 +394,7 @@ inherit_flags (child)
        * Its a member of a cycle, look at all parents from outside
        * the cycle.
        */
-      head->cg.print_flag = false;
+      head->cg.print_flag = FALSE;
       head->cg.prop.fract = 0.0;
       for (member = head->cg.cyc.next; member; member = member->cg.cyc.next)
        {
@@ -434,8 +435,7 @@ inherit_flags (child)
  * and while we're here, sum time for functions.
  */
 static void
-propagate_flags (symbols)
-     Sym **symbols;
+propagate_flags (Sym **symbols)
 {
   int index;
   Sym *old_head, *child;
@@ -471,7 +471,7 @@ propagate_flags (symbols)
              || (syms[INCL_GRAPH].len == 0
                  && !sym_lookup (&syms[EXCL_GRAPH], child->addr)))
            {
-             child->cg.print_flag = true;
+             child->cg.print_flag = TRUE;
            }
        }
       else
@@ -484,7 +484,7 @@ propagate_flags (symbols)
          if (!sym_lookup (&syms[INCL_GRAPH], child->addr)
              && sym_lookup (&syms[EXCL_GRAPH], child->addr))
            {
-             child->cg.print_flag = false;
+             child->cg.print_flag = FALSE;
            }
        }
       if (child->cg.prop.fract == 0.0)
@@ -535,9 +535,7 @@ propagate_flags (symbols)
  * first.  All else being equal, compare by names.
  */
 static int
-cmp_total (lp, rp)
-     const PTR lp;
-     const PTR rp;
+cmp_total (const PTR lp, const PTR rp)
 {
   const Sym *left = *(const Sym **) lp;
   const Sym *right = *(const Sym **) rp;
@@ -622,7 +620,7 @@ cg_assemble ()
       parent->cg.prop.fract = 0.0;
       parent->cg.prop.self = 0.0;
       parent->cg.prop.child = 0.0;
-      parent->cg.print_flag = false;
+      parent->cg.print_flag = FALSE;
       parent->cg.top_order = DFN_NAN;
       parent->cg.cyc.num = 0;
       parent->cg.cyc.head = parent;