aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-11-17 06:07:30 -0800
committerNathan Sidwell <nathan@acm.org>2020-11-17 06:12:01 -0800
commit8a97aed0d290bc12b91091703444546d9b3edba7 (patch)
treeeaa8646dd871f738feb30a5df76996329da161a6 /libcpp
parente3b55ce50ec294f30106947bd819f12a98069c57 (diff)
downloadgcc-8a97aed0d290bc12b91091703444546d9b3edba7.zip
gcc-8a97aed0d290bc12b91091703444546d9b3edba7.tar.gz
gcc-8a97aed0d290bc12b91091703444546d9b3edba7.tar.bz2
langhooks: preprocessor hooks for c++ modules
This is a slightly modified version of 01-langhooks.def. I realized I didn't need the deferred macro langhook -- that can be directly installed into the preprocessor callbacks via preprocess_options lang hook. gcc/ * langhooks-def.h (LANG_HOOKS_PREPROCESS_MAIN_FILE) (LANG_HOOKS_PREPROCESS_OPTIONS, LANG_HOOKS_PREPROCESS_UNDEF) (LANG_HOOKS_PREPROCESS_TOKEN): New. (LANG_HOOKS_INITIALIZER): Add them. * langhooks.h (struct lang_hooks): Add preprocess_main_file, preprocess_options, preprocess_undef, preprocess_token hooks. Add enum PT_flags. gcc/c-family/ * c-lex.c: #include "langhooks.h". (cb_undef): Maybe call preprocess_undef lang hook. * c-opts.c (c_common_post_options): Maybe call preprocess_options lang hook. (push_command_line_include): Maybe call preprocess_main_file lang hook. (cb_file_change): Likewise. * c-ppoutput.c: #include "langhooks.h. (scan_translation_unit): Maybe call preprocess_token lang hook. (class do_streamer): New, derive from token_streamer. (directives_only_cb): Data pointer is do_streamer, call preprocess_token lang hook. (scan_translation_unit_directives_only): Use do_streamer. (print_line_1): Move src_line recording to after string output. (cb_undef): Maybe call preprocess_undef lang hook.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions