cpplib.h (struct cpp_callbacks): Add user_builtin_macro callback.
* include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro callback. (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER. (cpp_macro_definition): Remove const qual from second argument. * macro.c (enter_macro_context): Call user_builtin_macro callback for NODE_BUILTIN !NODE_USED macros. (warn_of_redefinition): Likewise. Remove const qual from second argument. (cpp_macro_definition): Likewise. * pch.c (write_macdef, save_macros): Call user_builtin_macro callback for NODE_BUILTIN !NODE_USED macros. * c-family/c-cppbuiltin.c: Include cpp-id-data.h. (lazy_hex_fp_values, lazy_hex_fp_value_count): New variables. (lazy_hex_fp_value): New function. (builtin_define_with_hex_fp_value): Provide definitions lazily. * Makefile.in (c-family/c-cppbuiltin.o): Depend on $(CPP_ID_DATA_H). From-SVN: r160626
This commit is contained in:
parent
7b14477e38
commit
8e680db5b6
7 changed files with 130 additions and 14 deletions
|
@ -509,6 +509,9 @@ struct cpp_callbacks
|
|||
/* Called whenever a macro is expanded or tested.
|
||||
Second argument is the location of the start of the current expansion. */
|
||||
void (*used) (cpp_reader *, source_location, cpp_hashnode *);
|
||||
|
||||
/* Callback that can change a user builtin into normal macro. */
|
||||
bool (*user_builtin_macro) (cpp_reader *, cpp_hashnode *);
|
||||
};
|
||||
|
||||
#ifdef VMS
|
||||
|
@ -599,7 +602,9 @@ enum cpp_builtin_type
|
|||
BT_STDC, /* `__STDC__' */
|
||||
BT_PRAGMA, /* `_Pragma' operator */
|
||||
BT_TIMESTAMP, /* `__TIMESTAMP__' */
|
||||
BT_COUNTER /* `__COUNTER__' */
|
||||
BT_COUNTER, /* `__COUNTER__' */
|
||||
BT_FIRST_USER, /* User defined builtin macros. */
|
||||
BT_LAST_USER = BT_FIRST_USER + 31
|
||||
};
|
||||
|
||||
#define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE))
|
||||
|
@ -726,7 +731,7 @@ extern const cpp_token *cpp_get_token (cpp_reader *);
|
|||
extern const cpp_token *cpp_get_token_with_location (cpp_reader *,
|
||||
source_location *);
|
||||
extern const unsigned char *cpp_macro_definition (cpp_reader *,
|
||||
const cpp_hashnode *);
|
||||
cpp_hashnode *);
|
||||
extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
|
||||
extern const cpp_token *cpp_peek_token (cpp_reader *, int);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue