annotate gcc/run-rtl-passes.c @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
kono
parents:
diff changeset
1 /* run-rtl-passes.c - Run RTL passes directly from frontend
kono
parents:
diff changeset
2 Copyright (C) 2016-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #include "config.h"
kono
parents:
diff changeset
21 #include "system.h"
kono
parents:
diff changeset
22 #include "coretypes.h"
kono
parents:
diff changeset
23 #include "target.h"
kono
parents:
diff changeset
24 #include "rtl.h"
kono
parents:
diff changeset
25 #include "function.h"
kono
parents:
diff changeset
26 #include "basic-block.h"
kono
parents:
diff changeset
27 #include "tree-pass.h"
kono
parents:
diff changeset
28 #include "context.h"
kono
parents:
diff changeset
29 #include "pass_manager.h"
kono
parents:
diff changeset
30 #include "bitmap.h"
kono
parents:
diff changeset
31 #include "df.h"
kono
parents:
diff changeset
32 #include "regs.h"
kono
parents:
diff changeset
33 #include "insn-attr-common.h" /* for INSN_SCHEDULING. */
kono
parents:
diff changeset
34 #include "insn-attr.h" /* for init_sched_attrs. */
kono
parents:
diff changeset
35 #include "run-rtl-passes.h"
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* Run the backend passes, starting at the given pass.
kono
parents:
diff changeset
38 Take ownership of INITIAL_PASS_NAME. */
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 void
kono
parents:
diff changeset
41 run_rtl_passes (char *initial_pass_name)
kono
parents:
diff changeset
42 {
kono
parents:
diff changeset
43 cfun->pass_startwith = initial_pass_name;
kono
parents:
diff changeset
44 max_regno = max_reg_num ();
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* Pass "expand" normally sets this up. */
kono
parents:
diff changeset
47 #ifdef INSN_SCHEDULING
kono
parents:
diff changeset
48 init_sched_attrs ();
kono
parents:
diff changeset
49 #endif
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 bitmap_obstack_initialize (NULL);
kono
parents:
diff changeset
52 bitmap_obstack_initialize (&reg_obstack);
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 opt_pass *rest_of_compilation
kono
parents:
diff changeset
55 = g->get_passes ()->get_rest_of_compilation ();
kono
parents:
diff changeset
56 gcc_assert (rest_of_compilation);
kono
parents:
diff changeset
57 execute_pass_list (cfun, rest_of_compilation);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 opt_pass *clean_slate = g->get_passes ()->get_clean_slate ();
kono
parents:
diff changeset
60 gcc_assert (clean_slate);
kono
parents:
diff changeset
61 execute_pass_list (cfun, clean_slate);
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 bitmap_obstack_release (&reg_obstack);
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 cfun->curr_properties |= PROP_rtl;
kono
parents:
diff changeset
66 }