OSDN Git Service

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