Hi,
   Because gcc has some struct renamed, and this cause plugin.diff did
not apply to the trunk source of gcc. Indeed, it apply successfully,
but compile failed.
  So, I figure out a new patch for the plugin.diff. I paste it later.




diff --git a/plugin.diff b/plugin.diff
--- a/plugin.diff
+++ b/plugin.diff
@@ -1,7 +1,7 @@ diff --git a/configure b/configure
 diff --git a/configure b/configure
 --- a/configure
 +++ b/configure
-@@ -4368,7 +4368,7 @@ do_compare="$gcc_cv_prog_cmp_skip"
+@@ -4453,7 +4453,7 @@ do_compare="$gcc_cv_prog_cmp_skip"


  # Check for GMP and MPFR
@@ -13,7 +13,7 @@ diff --git a/configure.ac b/configure.ac
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1139,7 +1139,7 @@ ACX_PROG_CMP_IGNORE_INITIAL
+@@ -1175,7 +1175,7 @@ ACX_PROG_CMP_IGNORE_INITIAL
  ACX_PROG_CMP_IGNORE_INITIAL

  # Check for GMP and MPFR
@@ -25,7 +25,7 @@ diff --git a/gcc/Makefile.in b/gcc/Makef
 diff --git a/gcc/Makefile.in b/gcc/Makefile.in
 --- a/gcc/Makefile.in
 +++ b/gcc/Makefile.in
-@@ -1146,6 +1146,7 @@ OBJS-common = \
+@@ -1138,6 +1138,7 @@ OBJS-common = \
        tree-cfg.o \
        tree-cfgcleanup.o \
        tree-chrec.o \
@@ -33,7 +33,7 @@ diff --git a/gcc/Makefile.in b/gcc/Makef
        tree-complex.o \
        tree-data-ref.o \
        tree-dfa.o \
-@@ -2013,6 +2014,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG
+@@ -2015,6 +2016,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG
     $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
     $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) \
     $(DIAGNOSTIC_H) $(TIMEVAR_H)
@@ -41,7 +41,7 @@ diff --git a/gcc/Makefile.in b/gcc/Makef
  tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H)
coretypes.h \
     $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
     $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $
(TIMEVAR_H) \
-@@ -3121,6 +3123,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp
+@@ -3140,6 +3142,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp
    $(srcdir)/tree-ssa-structalias.c $(srcdir)/tree-parloops.c \
    $(srcdir)/omp-low.c $(srcdir)/varpool.c \
    $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/
cgraphunit.c \
@@ -63,7 +63,7 @@ diff --git a/gcc/c-common.c b/gcc/c-comm
 diff --git a/gcc/c-common.c b/gcc/c-common.c
 --- a/gcc/c-common.c
 +++ b/gcc/c-common.c
-@@ -663,6 +663,8 @@ const struct attribute_spec c_common_att
+@@ -684,6 +684,8 @@ const struct attribute_spec c_common_att
                              handle_error_attribute },
    { "error",                1, 1, true,  false, false,
                              handle_error_attribute },
@@ -135,7 +135,7 @@ diff --git a/gcc/cp/class.c b/gcc/cp/cla

  /* The number of nested classes being processed.  If we are not in
the
     scope of any class, this is zero.  */
-@@ -5263,6 +5264,7 @@ finish_struct_1 (tree t)
+@@ -5269,6 +5270,7 @@ finish_struct_1 (tree t)

    /* Finish debugging output for this type.  */
    rest_of_type_compilation (t, ! LOCAL_CLASS_P (t));
@@ -154,7 +154,7 @@ diff --git a/gcc/cp/decl.c b/gcc/cp/decl

  static tree grokparms (cp_parameter_declarator *, tree *);
  static const char *redeclaration_error_message (tree, tree);
-@@ -11919,6 +11920,7 @@ finish_function (int flags)
+@@ -11929,6 +11930,7 @@ finish_function (int flags)
    if (!processing_template_decl)
      {
        struct language_function *f = DECL_SAVED_FUNCTION_DATA
(fndecl);
@@ -200,7 +200,7 @@ diff --git a/gcc/toplev.c b/gcc/toplev.c

  static void general_init (const char *);
  static void do_compile (void);
-@@ -311,6 +312,11 @@ rtx stack_limit_rtx;
+@@ -314,6 +315,11 @@ rtx stack_limit_rtx;
     flag_var_tracking == AUTODETECT_VALUE it will be set according
     to optimize, debug_info_level and debug_hooks in process_options
().  */
  int flag_var_tracking = AUTODETECT_VALUE;
@@ -212,7 +212,7 @@ diff --git a/gcc/toplev.c b/gcc/toplev.c

  /* True if the user has tagged the function with the 'section'
     attribute.  */
-@@ -2129,6 +2135,7 @@ finalize (void)
+@@ -2125,6 +2131,7 @@ finalize (void)

    /* Language-specific end of compilation actions.  */
    lang_hooks.finish ();
@@ -270,7 +270,7 @@ new file mode 100644
 +
 +static void init(void);
 +
-+extern struct tree_opt_pass pass_plugin;
++extern struct opt_pass pass_plugin;
 +
 +/* Allows to see C++ AST before gimplification */
 +void plugin_cp_pre_genericize (tree fndecl) {
@@ -314,8 +314,8 @@ new file mode 100644
 +}
 +
 +/* setup the plugin pass to run after prior_plugin_name */
-+static bool position_pass (const char *prior_plugin_name, struct
tree_opt_pass *top_pass) {
-+    struct tree_opt_pass *p = top_pass ? top_pass :
all_lowering_passes;
++static bool position_pass (const char *prior_plugin_name, struct
opt_pass *top_pass) {
++    struct opt_pass *p = top_pass ? top_pass : all_lowering_passes;
 +    for (; p; p = p->next) {
 +        if (p->name && !strcmp(p->name, prior_plugin_name)) {
 +            break;
@@ -395,8 +395,9 @@ new file mode 100644
 +    fptr_plugin_post_parse();
 +}
 +
-+struct tree_opt_pass pass_plugin =
++struct opt_pass pass_plugin =
 +{
++  GIMPLE_PASS,            /*pass type*/
 +  "plugin",                           /* name */
 +  gate_plugin_pass,                   /* gate */
 +  execute_plugin_pass,                        /* execute */
@@ -409,7 +410,6 @@ new file mode 100644
 +  0,                                  /* properties_destroyed */
 +  0,                                  /* todo_flags_start */
 +  TODO_dump_func,                     /* todo_flags_finish */
-+  0                                   /* letter */
 +};
 diff --git a/gcc/tree-plugin-pass.h b/gcc/tree-plugin-pass.h
 new file mode 100644
_______________________________________________
Dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis

Reply via email to