diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-08-17 23:18:11 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-08-17 23:18:11 +0000 |
commit | 800c0e9877f2adce864fd3e0c0ee5906bd32736f (patch) | |
tree | d259b37b7b95254179ac5634b71a84ce199430fe /libcpp/pch.c | |
parent | 6f0821f4468b774cefe0a00560ed4bd290835fe2 (diff) | |
download | gcc-800c0e9877f2adce864fd3e0c0ee5906bd32736f.zip gcc-800c0e9877f2adce864fd3e0c0ee5906bd32736f.tar.gz gcc-800c0e9877f2adce864fd3e0c0ee5906bd32736f.tar.bz2 |
[PATCH] Adjust lazy macro definition
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01072.html
libcpp/
* include/cpplib.h (struct cpp_callbacks): Replace
user_builtin_macro with user_lazy_macro.
(struct cpp_macro): add lazy field.
(enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
(cpp_define_lazily): Declare.
* macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
(warn_of_redefinition): Use cpp_builtin_macro_p, directly call
user_lazy_macro hook.
(_cpp_new_macro): Clear lazy field.
(cpp_define_lazily): Define.
(_cpp_notify_macro_use): Adjust lazy definition code.
(cpp_macro_definition): No need to do lazy definition here.
* pch.c (write_macdef, save_macros): Likewise.
gcc/c-family/
* c-cppbuiltin.c (struct lazy_hex_fp_value_struct): Remove macro
field.
(laxy_hex_fp_value_count): Make unsigned.
(lazy_hex_fp_value): Provided with macro & lazy number. Directly
manipulate the macro.
(builtin_defin_with_hex_fp_value): Adjust callback name, use
cpp_define_lazily.
From-SVN: r263640
Diffstat (limited to 'libcpp/pch.c')
-rw-r--r-- | libcpp/pch.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libcpp/pch.c b/libcpp/pch.c index 997c4da..47b99c1 100644 --- a/libcpp/pch.c +++ b/libcpp/pch.c @@ -59,9 +59,7 @@ write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p) /* FALLTHRU */ case NT_MACRO: - if ((hn->flags & NODE_BUILTIN) - && (!pfile->cb.user_builtin_macro - || !pfile->cb.user_builtin_macro (pfile, hn))) + if (hn->flags & NODE_BUILTIN) return 1; { @@ -760,11 +758,6 @@ save_macros (cpp_reader *r, cpp_hashnode *h, void *data_p) { struct save_macro_data *data = (struct save_macro_data *)data_p; - if ((h->flags & NODE_BUILTIN) - && h->type == NT_MACRO - && r->cb.user_builtin_macro) - r->cb.user_builtin_macro (r, h); - if (h->type != NT_VOID && (h->flags & NODE_BUILTIN) == 0) { |