diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-11-17 08:16:50 -0800 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-11-17 08:22:02 -0800 |
commit | b196e76aecb675b9f6a1e4f15419606621459401 (patch) | |
tree | c5fe1672d108637c16eebda4a74b15d16b590218 /libcpp | |
parent | ecf65330c11544ebf35e198087b4a42be089c620 (diff) | |
download | gcc-b196e76aecb675b9f6a1e4f15419606621459401.zip gcc-b196e76aecb675b9f6a1e4f15419606621459401.tar.gz gcc-b196e76aecb675b9f6a1e4f15419606621459401.tar.bz2 |
preprocessor: new callbacks
These two callbacks are needed for C++ modules. The first is for
handling macros from header-units. These are resolved lazily. The
second is for include-translation -- whether a #include gets turned
into a header-unit import.
libcpp/
* include/cpplib.h (struct cpp_callbacks): Add
user_deferred_macro & translate_include.
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/include/cpplib.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index ce00952..d232426 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -680,6 +680,9 @@ struct cpp_callbacks /* Callback that can change a user lazy into normal macro. */ void (*user_lazy_macro) (cpp_reader *, cpp_macro *, unsigned); + /* Callback to handle deferred cpp_macros. */ + cpp_macro *(*user_deferred_macro) (cpp_reader *, location_t, cpp_hashnode *); + /* Callback to parse SOURCE_DATE_EPOCH from environment. */ time_t (*get_source_date_epoch) (cpp_reader *); @@ -698,6 +701,11 @@ struct cpp_callbacks /* Callback for filename remapping in __FILE__ and __BASE_FILE__ macro expansions. */ const char *(*remap_filename) (const char*); + + /* Maybe translate a #include into something else. Return a + cpp_buffer containing the translation if translating. */ + char *(*translate_include) (cpp_reader *, line_maps *, location_t, + const char *path); }; #ifdef VMS |