]>
Commit | Line | Data |
---|---|---|
4ee9c684 | 1 | /* Mudflap: narrow-pointer bounds-checking by tree rewriting. |
63fb44ba | 2 | Copyright (C) 2001, 2002, 2003, 2007, 2008, 2009 |
3 | Free Software Foundation, Inc. | |
4ee9c684 | 4 | Contributed by Frank Ch. Eigler <fche@redhat.com> |
5 | ||
6 | This file is part of GCC. | |
7 | ||
8 | GCC is free software; you can redistribute it and/or modify it under | |
9 | the terms of the GNU General Public License as published by the Free | |
8c4c00c1 | 10 | Software Foundation; either version 3, or (at your option) any later |
4ee9c684 | 11 | version. |
12 | ||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
8c4c00c1 | 19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
4ee9c684 | 21 | |
22 | ||
23 | #include "config.h" | |
4ee9c684 | 24 | #include "system.h" |
25 | #include "coretypes.h" | |
26 | #include "tm.h" | |
27 | #include "tree.h" | |
28 | #include "tree-inline.h" | |
75a70cf9 | 29 | #include "gimple.h" |
4ee9c684 | 30 | #include "diagnostic.h" |
31 | #include "hashtab.h" | |
32 | #include "output.h" | |
33 | #include "varray.h" | |
34 | #include "langhooks.h" | |
35 | #include "tree-mudflap.h" | |
36 | #include "tree-pass.h" | |
37 | #include "ggc.h" | |
690abe5d | 38 | #include "toplev.h" |
4ee9c684 | 39 | |
40 | ||
41 | ||
42 | /* This file contains placeholder functions, to be used only for | |
43 | language processors that cannot handle tree-mudflap.c directly. | |
44 | (e.g. Fortran). */ | |
45 | ||
46 | static void | |
47 | nogo (void) | |
48 | { | |
49 | internal_error ("mudflap: this language is not supported"); | |
50 | } | |
51 | ||
52 | void | |
53 | mudflap_enqueue_decl (tree obj ATTRIBUTE_UNUSED) | |
54 | { | |
55 | nogo (); | |
56 | } | |
57 | ||
58 | void | |
59 | mudflap_enqueue_constant (tree obj ATTRIBUTE_UNUSED) | |
60 | { | |
61 | nogo (); | |
62 | } | |
63 | ||
64 | void | |
65 | mudflap_finish_file (void) | |
66 | { | |
67 | nogo (); | |
68 | } | |
69 | ||
70 | int | |
71 | mf_marked_p (tree t ATTRIBUTE_UNUSED) | |
72 | { | |
73 | nogo (); | |
74 | return 0; | |
75 | } | |
76 | ||
77 | tree | |
78 | mf_mark (tree t ATTRIBUTE_UNUSED) | |
79 | { | |
80 | nogo (); | |
81 | return NULL; | |
82 | } | |
83 | ||
84 | /* The pass structures must exist, but need not do anything. */ | |
85 | ||
34d1dd5d | 86 | static bool |
87 | gate_mudflap (void) | |
88 | { | |
89 | return flag_mudflap != 0; | |
90 | } | |
91 | ||
20099e35 | 92 | struct gimple_opt_pass pass_mudflap_1 = |
4ee9c684 | 93 | { |
20099e35 | 94 | { |
95 | GIMPLE_PASS, | |
4ee9c684 | 96 | "mudflap1", /* name */ |
34d1dd5d | 97 | gate_mudflap, /* gate */ |
4ee9c684 | 98 | NULL, /* execute */ |
99 | NULL, /* sub */ | |
100 | NULL, /* next */ | |
101 | 0, /* static_pass_number */ | |
0b1615c1 | 102 | TV_NONE, /* tv_id */ |
4ee9c684 | 103 | 0, /* properties_required */ |
104 | 0, /* properties_provided */ | |
105 | 0, /* properties_destroyed */ | |
106 | 0, /* todo_flags_start */ | |
20099e35 | 107 | 0 /* todo_flags_finish */ |
108 | } | |
4ee9c684 | 109 | }; |
110 | ||
20099e35 | 111 | struct gimple_opt_pass pass_mudflap_2 = |
4ee9c684 | 112 | { |
20099e35 | 113 | { |
114 | GIMPLE_PASS, | |
4ee9c684 | 115 | "mudflap2", /* name */ |
34d1dd5d | 116 | gate_mudflap, /* gate */ |
4ee9c684 | 117 | NULL, /* execute */ |
118 | NULL, /* sub */ | |
119 | NULL, /* next */ | |
120 | 0, /* static_pass_number */ | |
0b1615c1 | 121 | TV_NONE, /* tv_id */ |
4ee9c684 | 122 | 0, /* properties_required */ |
123 | 0, /* properties_provided */ | |
124 | 0, /* properties_destroyed */ | |
125 | 0, /* todo_flags_start */ | |
20099e35 | 126 | 0 /* todo_flags_finish */ |
127 | } | |
4ee9c684 | 128 | }; |
129 | ||
130 | /* Instead of: | |
131 | #include "gt-tree-mudflap.h" | |
132 | We prepare a little dummy struct here. | |
133 | */ | |
134 | ||
cd819d2f | 135 | EXPORTED_CONST struct ggc_root_tab gt_ggc_r_gt_tree_mudflap_h[] = { |
4ee9c684 | 136 | LAST_GGC_ROOT_TAB |
137 | }; |