OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [plugin/] [one_time_plugin.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Plugin that prints message if it inserted (and invoked) more than once. */
2
#include "config.h"
3
#include "gcc-plugin.h"
4
#include "system.h"
5
#include "coretypes.h"
6
#include "tm.h"
7
#include "toplev.h"
8
#include "gimple.h"
9
#include "tree-pass.h"
10
#include "intl.h"
11
 
12
int plugin_is_GPL_compatible;
13
 
14
static bool one_pass_gate (void)
15
{
16
  return true;
17
}
18
 
19
static unsigned int one_pass_exec (void)
20
{
21
  static int counter = 0;
22
 
23
  if (counter > 0) {
24
    printf ("Executed more than once \n");
25
 }
26
 counter++;
27
 return 0;
28
}
29
 
30
struct gimple_opt_pass one_pass =
31
{
32
  {
33
  GIMPLE_PASS,
34
  "cfg",                           /* name */
35
  one_pass_gate,                         /* gate */
36
  one_pass_exec,       /* execute */
37
  NULL,                                 /* sub */
38
  NULL,                                 /* next */
39
  0,                                    /* static_pass_number */
40
  0,                                    /* tv_id */
41
  PROP_gimple_any,                      /* properties_required */
42
  0,                                    /* properties_provided */
43
  0,                                    /* properties_destroyed */
44
  0,                                    /* todo_flags_start */
45
  TODO_dump_func                        /* todo_flags_finish */
46
  }
47
};
48
 
49
 
50
int plugin_init (struct plugin_name_args *plugin_info,
51
                 struct plugin_gcc_version *version)
52
{
53
  struct register_pass_info p;
54
 
55
  p.pass = &one_pass.pass;
56
  p.reference_pass_name = "cfg";
57
  p.ref_pass_instance_number = 1;
58
  p.pos_op = PASS_POS_INSERT_AFTER;
59
 
60
  register_callback ("one_pass", PLUGIN_PASS_MANAGER_SETUP, NULL, &p);
61
 
62
  return 0;
63
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.