[01/32] langhooks

Nathan Sidwell nathan@acm.org
Tue Nov 3 21:13:13 GMT 2020

I needed a set of hook interfacing the preprocessor to the language. 
they get called from pieces in c-family.

preprocess_main_file:  we need to know when any forced headers have been 
parsed in order to deal with linemaps and macro visibility

preprocess_options: A way for the language to adjust any preprocessor 
options and alter direct callbacks

preprocess_undef: We need visibility of #undefs

preprocess_deferred_macro: macros from header-units are instantiated 
lazily.  This is the hook for the preprocessor to get that done.

preprocess_token: Even in -E processing, we need to observe the token 
stream in order to load up the macro tables of header units.

c-family's c-lex.c, c-opts.c & c-ppoutput.c get to call these hooks in 
various cases

Nathan Sidwell

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-langhooks.diff
Type: text/x-patch
Size: 13417 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201103/342892e2/attachment.bin>

More information about the Gcc-patches mailing list