* gcc-plugin.h (enum plugin_event): Add PLUGIN_ALL_IPA_PASSES_START,
[official-gcc.git] / gcc / highlev-plugin.h
bloba5c1d439742525c004c0d744b66781edfc1782bb
1 /* Plugin-side interface for high-level plugins in GCC.
2 Copyright (C) 2009 Free Software Foundation, Inc.
4 Contributed by Inria.
6 Authors: Grigori Fursin <grigori.fursin@inria.fr>, Cupertino Miranda
7 <cupertinomiranda@gmail.com>, Zbigniew Chamski <zbigniew.chamski@gmail.com>.
9 This file is part of GCC.
11 GCC is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation; either version 3, or (at your option) any later
14 version.
16 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 for more details.
21 You should have received a copy of the GNU General Public License
22 along with GCC; see the file COPYING3. If not see
23 <http://www.gnu.org/licenses/>. */
25 #ifndef HIGHLEV_PLUGIN_H
26 #define HIGHLEV_PLUGIN_H
28 /* Callback type for high-level argument-less event callbacks */
29 typedef void (*event_callback_t) (void);
31 /* Datatype of event parameter structure. */
32 typedef enum
34 EP_SILENT, /* Used to pass infomation between ICI and plugin,
35 parameter of this type will not be recorded.
36 The data type is int. */
37 EP_VOID,
38 EP_CHAR,
39 EP_UNSIGNED_CHAR,
40 EP_INT,
41 EP_UNSIGNED,
42 EP_LONG,
43 EP_UNSIGNED_LONG
44 } event_parameter_type;
46 /* manipulation of event tables and callback lists */
47 extern void register_plugin_event (const char *name, event_callback_t func);
48 extern void unregister_plugin_event (const char *name);
49 extern int call_plugin_event (const char *event_name);
50 extern const char **list_plugin_events (void);
52 /* manipulation of event parameter (callback arg) tables */
53 extern const char **list_event_parameters (void);
54 extern void *get_event_parameter (const char *name);
55 extern event_parameter_type get_event_parameter_type (const char *name)
57 /* pass management */
58 extern const char **list_passes (void);
59 extern void run_pass (const char *pass_name);
60 extern void run_ipa_pass (const char *pass_name);
61 extern void *initialize_ici_pass_list (int);
62 extern void insert_ici_pass_list (void *, int, const char *);
63 extern void run_ici_pass_list (void *);
64 extern void run_ici_pass_list_ipa_summary (void *);
65 extern void run_ici_pass_list_per_function (void *);
66 extern void delete_ici_pass_list (void *);
68 /* Info needed by adaptation. */
69 typedef struct {
70 int numofclonefun;
71 char **clone_function_list;
72 char **function_filename_list;
73 int *clones;
74 char **clone_extension;
75 char **adaptation_function;
76 char **clone_option;
77 char *external_libraries;
78 } cloneinfo ;
80 typedef struct {
81 int numofinstrfun;
82 char **instrument_function_list;
83 char **function_filename_list;
84 char **timer1;
85 char **timer2;
86 char *cloned;
87 } instrinfo ;
89 #endif /* HIGHLEV_PLUGIN_H */