OSDN Git Service

2010-04-29 Brian Hackett <bhackett1024@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-nomudflap.c
index 00ebd6d..c035f76 100644 (file)
@@ -1,12 +1,13 @@
 /* Mudflap: narrow-pointer bounds-checking by tree rewriting.
 /* Mudflap: narrow-pointer bounds-checking by tree rewriting.
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2007, 2008, 2009
+   Free Software Foundation, Inc.
    Contributed by Frank Ch. Eigler <fche@redhat.com>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
    Contributed by Frank Ch. Eigler <fche@redhat.com>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -15,9 +16,8 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 
 #include "config.h"
 
 
 #include "config.h"
@@ -26,13 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "tm.h"
 #include "tree.h"
 #include "tree-inline.h"
 #include "tm.h"
 #include "tree.h"
 #include "tree-inline.h"
-#include "c-tree.h"
-#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
 #include "diagnostic.h"
 #include "hashtab.h"
 #include "output.h"
 #include "diagnostic.h"
 #include "hashtab.h"
 #include "output.h"
-#include "varray.h"
 #include "langhooks.h"
 #include "tree-mudflap.h"
 #include "tree-pass.h"
 #include "langhooks.h"
 #include "tree-mudflap.h"
 #include "tree-pass.h"
@@ -85,38 +82,48 @@ mf_mark (tree t ATTRIBUTE_UNUSED)
 
 /* The pass structures must exist, but need not do anything.  */
 
 
 /* The pass structures must exist, but need not do anything.  */
 
-struct tree_opt_pass pass_mudflap_1 = 
+static bool
+gate_mudflap (void)
 {
 {
+  return flag_mudflap != 0;
+}
+
+struct gimple_opt_pass pass_mudflap_1 =
+{
+ {
+  GIMPLE_PASS,
   "mudflap1",                          /* name */
   "mudflap1",                          /* name */
-  NULL,                                        /* gate */
+  gate_mudflap,                         /* gate */
   NULL,                                        /* execute */
   NULL,                                        /* sub */
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   NULL,                                        /* execute */
   NULL,                                        /* sub */
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
-  0,                                   /* tv_id */
+  TV_NONE,                             /* tv_id */
   0,                                   /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   0,                                   /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  0,                                    /* todo_flags_finish */
-  0                                    /* letter */
+  0                                     /* todo_flags_finish */
+ }
 };
 
 };
 
-struct tree_opt_pass pass_mudflap_2 = 
+struct gimple_opt_pass pass_mudflap_2 =
 {
 {
+ {
+  GIMPLE_PASS,
   "mudflap2",                          /* name */
   "mudflap2",                          /* name */
-  NULL,                                        /* gate */
+  gate_mudflap,                         /* gate */
   NULL,                                        /* execute */
   NULL,                                        /* sub */
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   NULL,                                        /* execute */
   NULL,                                        /* sub */
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
-  0,                                   /* tv_id */
+  TV_NONE,                             /* tv_id */
   0,                                   /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   0,                                   /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  0,                                    /* todo_flags_finish */
-  0                                    /* letter */
+  0                                     /* todo_flags_finish */
+ }
 };
 
 /* Instead of:
 };
 
 /* Instead of:
@@ -124,6 +131,6 @@ struct tree_opt_pass pass_mudflap_2 =
 We prepare a little dummy struct here.
 */
 
 We prepare a little dummy struct here.
 */
 
-const struct ggc_root_tab gt_ggc_r_gt_tree_mudflap_h[] = {
+EXPORTED_CONST struct ggc_root_tab gt_ggc_r_gt_tree_mudflap_h[] = {
   LAST_GGC_ROOT_TAB
 };
   LAST_GGC_ROOT_TAB
 };