plugins.texi (Registering custom attributes): section renamed as (Registering custom attributes or pragmas).
2009-11-11 Basile Starynkevitch <basile@starynkevitch.net> * gcc/doc/plugins.texi (Registering custom attributes): section renamed as (Registering custom attributes or pragmas). Mentions custom attributes & pragmas, and c_register_pragma, with a small example. * gcc/doc/cpp.texi (Pragmas): Mentions that plugins can provide their pragmas. * gcc/doc/extend.texi (Function Attributes): Mentions that plugin can provide their attributes. From-SVN: r154097
This commit is contained in:
parent
aa4945c138
commit
110532c838
4 changed files with 39 additions and 3 deletions
|
@ -1,4 +1,13 @@
|
|||
gcc/
|
||||
2009-11-11 Basile Starynkevitch <basile@starynkevitch.net>
|
||||
* doc/plugins.texi (Registering custom attributes): section
|
||||
renamed as (Registering custom attributes or pragmas).
|
||||
Mentions custom attributes & pragmas, and c_register_pragma, with
|
||||
a small example.
|
||||
* doc/cpp.texi (Pragmas): Mentions that plugins can provide their
|
||||
pragmas.
|
||||
* doc/extend.texi (Function Attributes): Mentions that plugin can
|
||||
provide their attributes.
|
||||
|
||||
2009-11-11 Jon Beniston <jon@beniston.com>
|
||||
|
||||
* config.gcc: Add lm32 elf and uclinux targets.
|
||||
|
|
|
@ -3541,6 +3541,8 @@ This manual documents the pragmas which are meaningful to the
|
|||
preprocessor itself. Other pragmas are meaningful to the C or C++
|
||||
compilers. They are documented in the GCC manual.
|
||||
|
||||
GCC plugins may provide their own pragmas.
|
||||
|
||||
@ftable @code
|
||||
@item #pragma GCC dependency
|
||||
@code{#pragma GCC dependency} allows you to check the relative dates of
|
||||
|
|
|
@ -1922,6 +1922,8 @@ particular target systems. Other attributes, including @code{section}
|
|||
are supported for variables declarations (@pxref{Variable Attributes})
|
||||
and for types (@pxref{Type Attributes}).
|
||||
|
||||
GCC plugins may provide their own attributes.
|
||||
|
||||
You may also specify attributes with @samp{__} preceding and following
|
||||
each keyword. This allows you to use them in header files without
|
||||
being concerned about a possible macro of the same name. For example,
|
||||
|
|
|
@ -261,9 +261,10 @@ Such a structure is passed as the @code{user_data} by the plugin's
|
|||
init routine using @code{register_callback} with the
|
||||
@code{PLUGIN_INFO} pseudo-event and a null callback.
|
||||
|
||||
@section Registering custom attributes
|
||||
@section Registering custom attributes or pragmas
|
||||
|
||||
For analysis purposes it is useful to be able to add custom attributes.
|
||||
For analysis (or other) purposes it is useful to be able to add custom
|
||||
attributes or pragmas.
|
||||
|
||||
The @code{PLUGIN_ATTRIBUTES} callback is called during attribute
|
||||
registration. Use the @code{register_attribute} function to register
|
||||
|
@ -295,6 +296,28 @@ register_attributes (void *event_data, void *data)
|
|||
@end smallexample
|
||||
|
||||
|
||||
The @code{PLUGIN_PRAGMAS} callback is called during pragmas
|
||||
registration. Use the @code{c_register_pragma} or
|
||||
@code{c_register_pragma_with_expansion} functions to register custom
|
||||
pragmas.
|
||||
|
||||
@smallexample
|
||||
/* Plugin callback called during pragmas registration. Registered with
|
||||
register_callback (plugin_name, PLUGIN_PRAGMAS,
|
||||
register_my_pragma, NULL);
|
||||
*/
|
||||
static void
|
||||
register_my_pragma (void *event_data, void *data)
|
||||
@{
|
||||
warning (0, G_("Callback to register pragmas"));
|
||||
c_register_pragma ("GCCPLUGIN", "sayhello", handle_pragma_sayhello);
|
||||
@}
|
||||
@end smallexample
|
||||
|
||||
It is suggested to pass @code{"GCCPLUGIN"} (or a short name identifying
|
||||
your plugin) as the ``space'' argument of your pragma.
|
||||
|
||||
|
||||
@section Building GCC plugins
|
||||
|
||||
If plugins are enabled, GCC installs the headers needed to build a
|
||||
|
|
Loading…
Add table
Reference in a new issue