]>
Commit | Line | Data |
---|---|---|
821d4118 | 1 | /* Target-dependent globals. |
71e45bc2 | 2 | Copyright (C) 2010, 2012 Free Software Foundation, Inc. |
821d4118 | 3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #include "config.h" | |
21 | #include "system.h" | |
22 | #include "coretypes.h" | |
23 | #include "tm.h" | |
24 | #include "insn-config.h" | |
25 | #include "machmode.h" | |
26 | #include "ggc.h" | |
27 | #include "toplev.h" | |
28 | #include "target-globals.h" | |
29 | #include "flags.h" | |
c3460481 | 30 | #include "regs.h" |
679bcc8d | 31 | #include "rtl.h" |
6d0eb0c4 | 32 | #include "hard-reg-set.h" |
5f00384a | 33 | #include "reload.h" |
6ebe4c69 | 34 | #include "expmed.h" |
2770cb33 | 35 | #include "expr.h" |
36 | #include "optabs.h" | |
d0f03375 | 37 | #include "libfuncs.h" |
e8aa5a28 | 38 | #include "cfgloop.h" |
a1e0509e | 39 | #include "ira-int.h" |
c6a6cdaa | 40 | #include "lra-int.h" |
3b9c3a16 | 41 | #include "builtins.h" |
049d15fc | 42 | #include "gcse.h" |
22d65d2c | 43 | #include "bb-reorder.h" |
c7944dce | 44 | #include "lower-subreg.h" |
821d4118 | 45 | |
46 | #if SWITCHABLE_TARGET | |
47 | struct target_globals default_target_globals = { | |
c3460481 | 48 | &default_target_flag_state, |
679bcc8d | 49 | &default_target_regs, |
6d0eb0c4 | 50 | &default_target_rtl, |
5f00384a | 51 | &default_target_hard_regs, |
6ebe4c69 | 52 | &default_target_reload, |
2770cb33 | 53 | &default_target_expmed, |
d0f03375 | 54 | &default_target_optabs, |
e8aa5a28 | 55 | &default_target_libfuncs, |
a1e0509e | 56 | &default_target_cfgloop, |
57 | &default_target_ira, | |
3b9c3a16 | 58 | &default_target_ira_int, |
c6a6cdaa | 59 | &default_target_lra_int, |
049d15fc | 60 | &default_target_builtins, |
22d65d2c | 61 | &default_target_gcse, |
c7944dce | 62 | &default_target_bb_reorder, |
63 | &default_target_lower_subreg | |
821d4118 | 64 | }; |
65 | ||
66 | struct target_globals * | |
67 | save_target_globals (void) | |
68 | { | |
69 | struct target_globals *g; | |
70 | ||
71 | g = ggc_alloc_target_globals (); | |
72 | g->flag_state = XCNEW (struct target_flag_state); | |
c3460481 | 73 | g->regs = XCNEW (struct target_regs); |
679bcc8d | 74 | g->rtl = ggc_alloc_cleared_target_rtl (); |
6d0eb0c4 | 75 | g->hard_regs = XCNEW (struct target_hard_regs); |
5f00384a | 76 | g->reload = XCNEW (struct target_reload); |
6ebe4c69 | 77 | g->expmed = XCNEW (struct target_expmed); |
2770cb33 | 78 | g->optabs = XCNEW (struct target_optabs); |
d0f03375 | 79 | g->libfuncs = ggc_alloc_cleared_target_libfuncs (); |
e8aa5a28 | 80 | g->cfgloop = XCNEW (struct target_cfgloop); |
a1e0509e | 81 | g->ira = XCNEW (struct target_ira); |
82 | g->ira_int = XCNEW (struct target_ira_int); | |
e1b48ffd | 83 | g->lra_int = XCNEW (struct target_lra_int); |
3b9c3a16 | 84 | g->builtins = XCNEW (struct target_builtins); |
049d15fc | 85 | g->gcse = XCNEW (struct target_gcse); |
22d65d2c | 86 | g->bb_reorder = XCNEW (struct target_bb_reorder); |
c7944dce | 87 | g->lower_subreg = XCNEW (struct target_lower_subreg); |
821d4118 | 88 | restore_target_globals (g); |
03a75ccf | 89 | init_reg_sets (); |
821d4118 | 90 | target_reinit (); |
91 | return g; | |
92 | } | |
93 | ||
94 | #endif |