Mercurial > hg > CbC > CbC_gcc
comparison gcc/doc/plugins.texi @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 @c Copyright (c) 2009 Free Software Foundation, Inc. | 1 @c Copyright (c) 2009, 2010 Free Software Foundation, Inc. |
2 @c Free Software Foundation, Inc. | 2 @c Free Software Foundation, Inc. |
3 @c This is part of the GCC manual. | 3 @c This is part of the GCC manual. |
4 @c For copying conditions, see the file gcc.texi. | 4 @c For copying conditions, see the file gcc.texi. |
5 | 5 |
6 @node Plugins | 6 @node Plugins |
20 | 20 |
21 The plugin arguments are parsed by GCC and passed to respective | 21 The plugin arguments are parsed by GCC and passed to respective |
22 plugins as key-value pairs. Multiple plugins can be invoked by | 22 plugins as key-value pairs. Multiple plugins can be invoked by |
23 specifying multiple @option{-fplugin} arguments. | 23 specifying multiple @option{-fplugin} arguments. |
24 | 24 |
25 A plugin can be simply given by its short name (no dots or | |
26 slashes). When simply passing @option{-fplugin=NAME}, the plugin is | |
27 loaded from the @file{plugin} directory, so @option{-fplugin=NAME} is | |
28 the same as @option{-fplugin=`gcc -print-file-name=plugin`/NAME.so}, | |
29 using backquote shell syntax to query the @file{plugin} directory. | |
25 | 30 |
26 @section Plugin API | 31 @section Plugin API |
27 | 32 |
28 Plugins are activated by the compiler at specific events as defined in | 33 Plugins are activated by the compiler at specific events as defined in |
29 @file{gcc-plugin.h}. For each event of interest, the plugin should | 34 @file{gcc-plugin.h}. For each event of interest, the plugin should |
146 PLUGIN_FINISH_TYPE, /* After finishing parsing a type. */ | 151 PLUGIN_FINISH_TYPE, /* After finishing parsing a type. */ |
147 PLUGIN_FINISH_UNIT, /* Useful for summary processing. */ | 152 PLUGIN_FINISH_UNIT, /* Useful for summary processing. */ |
148 PLUGIN_PRE_GENERICIZE, /* Allows to see low level AST in C and C++ frontends. */ | 153 PLUGIN_PRE_GENERICIZE, /* Allows to see low level AST in C and C++ frontends. */ |
149 PLUGIN_FINISH, /* Called before GCC exits. */ | 154 PLUGIN_FINISH, /* Called before GCC exits. */ |
150 PLUGIN_INFO, /* Information about the plugin. */ | 155 PLUGIN_INFO, /* Information about the plugin. */ |
151 PLUGIN_GGC_START, /* Called at start of GCC Garbage Collection. */ | 156 PLUGIN_GGC_START, /* Called at start of GCC Garbage Collection. */ |
152 PLUGIN_GGC_MARKING, /* Extend the GGC marking. */ | 157 PLUGIN_GGC_MARKING, /* Extend the GGC marking. */ |
153 PLUGIN_GGC_END, /* Called at end of GGC. */ | 158 PLUGIN_GGC_END, /* Called at end of GGC. */ |
154 PLUGIN_REGISTER_GGC_ROOTS, /* Register an extra GGC root table. */ | 159 PLUGIN_REGISTER_GGC_ROOTS, /* Register an extra GGC root table. */ |
155 PLUGIN_REGISTER_GGC_CACHES, /* Register an extra GGC cache table. */ | 160 PLUGIN_REGISTER_GGC_CACHES, /* Register an extra GGC cache table. */ |
156 PLUGIN_ATTRIBUTES, /* Called during attribute registration */ | 161 PLUGIN_ATTRIBUTES, /* Called during attribute registration */ |
157 PLUGIN_START_UNIT, /* Called before processing a translation unit. */ | 162 PLUGIN_START_UNIT, /* Called before processing a translation unit. */ |
158 PLUGIN_PRAGMAS, /* Called during pragma registration. */ | 163 PLUGIN_PRAGMAS, /* Called during pragma registration. */ |
159 /* Called before first pass from all_passes. */ | 164 /* Called before first pass from all_passes. */ |
160 PLUGIN_ALL_PASSES_START, | 165 PLUGIN_ALL_PASSES_START, |
161 /* Called after last pass from all_passes. */ | 166 /* Called after last pass from all_passes. */ |
162 PLUGIN_ALL_PASSES_END, | 167 PLUGIN_ALL_PASSES_END, |
163 /* Called before first ipa pass. */ | 168 /* Called before first ipa pass. */ |
405 | 410 |
406 On most systems, you can query this @code{plugin} directory by | 411 On most systems, you can query this @code{plugin} directory by |
407 invoking @command{gcc -print-file-name=plugin} (replace if needed | 412 invoking @command{gcc -print-file-name=plugin} (replace if needed |
408 @command{gcc} with the appropriate program path). | 413 @command{gcc} with the appropriate program path). |
409 | 414 |
415 Inside plugins, this @code{plugin} directory name can be queried by | |
416 calling @code{default_plugin_dir_name ()}. | |
417 | |
410 The following GNU Makefile excerpt shows how to build a simple plugin: | 418 The following GNU Makefile excerpt shows how to build a simple plugin: |
411 | 419 |
412 @smallexample | 420 @smallexample |
413 GCC=gcc | 421 GCC=gcc |
414 PLUGIN_SOURCE_FILES= plugin1.c plugin2.c | 422 PLUGIN_SOURCE_FILES= plugin1.c plugin2.c |