GNU Compiler Collection (GCC) Internals: Files |
---|
Next: Invoking the garbage collector, Previous: GGC Roots, Up: Type Information [Contents][Index]
Whenever you add GTY
markers to a source file that previously
had none, or create a new source file containing GTY
markers,
there are three things you need to do:
target_gtfiles
in
the appropriate port’s entries in config.gcc.
GTFILES
variable in Makefile.in.
gtfiles
variable defined in the appropriate
config-lang.in.
Headers should appear before non-headers in this list.
gtfiles
variable of all the front ends
that use it.
ifiles
in open_base_file
in gengtype.c.
For source files that aren’t header files, the machinery will generate a header file that should be included in the source file you just changed. The file will be called gt-path.h where path is the pathname relative to the gcc directory with slashes replaced by -, so for example the header file to be included in cp/parser.c is called gt-cp-parser.c. The generated header file should be included after everything else in the source file. Don’t forget to mention this file as a dependency in the Makefile!
For language frontends, there is another file that needs to be included somewhere. It will be called gtype-lang.h, where lang is the name of the subdirectory the language is contained in.
Plugins can add additional root tables. Run the gengtype
utility in plugin mode as gengtype -P pluginout.h source-dir
file-list plugin*.c
with your plugin files
plugin*.c using GTY
to generate the pluginout.h file.
The GCC build tree is needed to be present in that mode.
Next: Invoking the garbage collector, Previous: GGC Roots, Up: Type Information [Contents][Index]