Deleted Added
sdiff udiff text old ( 50397 ) new ( 52284 )
full compact
1/* Calculate branch probabilities, and basic block execution counts.
2 Copyright (C) 1990, 91-94, 96, 97, 1998 Free Software Foundation, Inc.
3 Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
4 based on some ideas from Dain Samples of UC Berkeley.
5 Further mangling by Bob Manson, Cygnus Support.
6
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU CC is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
21the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22
23/* ??? Really should not put insns inside of LIBCALL sequences, when putting
24 insns after a call, should look for the insn setting the retval, and
25 insert the insns after that one. */
26
27/* ??? Register allocation should use basic block execution counts to
28 give preference to the most commonly executed blocks. */
29

--- 18 unchanged lines hidden (view full) ---

48#include "insn-config.h"
49#include "output.h"
50#include "regs.h"
51#include "tree.h"
52#include "output.h"
53#include "gcov-io.h"
54#include "toplev.h"
55
56extern char * xmalloc ();
57
58/* One of these is dynamically created whenever we identify an arc in the
59 function. */
60
61struct adj_list
62{
63 int source;
64 int target;
65 int arc_count;

--- 1337 unchanged lines hidden (view full) ---

1403 if (arcptr->on_tree && ! bb_graph[ARC_SOURCE (arcptr)].on_tree)
1404 expand_spanning_tree (ARC_SOURCE (arcptr));
1405}
1406
1407/* Perform file-level initialization for branch-prob processing. */
1408
1409void
1410init_branch_prob (filename)
1411 char *filename;
1412{
1413 long len;
1414 int i;
1415
1416 if (flag_test_coverage)
1417 {
1418 /* Open an output file for the basic block/line number map. */
1419 int len = strlen (filename);

--- 243 unchanged lines hidden (view full) ---

1663 free (name);
1664
1665 fndecl = build_decl (FUNCTION_DECL, fnname,
1666 build_function_type (void_type_node, NULL_TREE));
1667 DECL_EXTERNAL (fndecl) = 0;
1668 TREE_PUBLIC (fndecl) = 1;
1669 DECL_ASSEMBLER_NAME (fndecl) = fnname;
1670 DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
1671 current_function_decl = fndecl;
1672 pushlevel (0);
1673 make_function_rtl (fndecl);
1674 init_function_start (fndecl, input_filename, lineno);
1675 expand_function_start (fndecl, 0);
1676
1677 /* Actually generate the code to call __bb_init_func. */
1678 name = xmalloc (20);
1679 ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);

--- 23 unchanged lines hidden ---