aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-04-23 17:03:31 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-23 17:03:31 +0000
commitd9e0bd53b2da36f66fcd18b168b354612ef7f4df (patch)
treedce0dfebe9bc09562c88a4bc2be4eecd8f6147d6 /gcc/cpplex.c
parent3c8c10b8c691cd1f8111f4eaf50ff22beadc0088 (diff)
downloadgcc-d9e0bd53b2da36f66fcd18b168b354612ef7f4df.zip
gcc-d9e0bd53b2da36f66fcd18b168b354612ef7f4df.tar.gz
gcc-d9e0bd53b2da36f66fcd18b168b354612ef7f4df.tar.bz2
cpphash.h (struct definition): Move file, line, col members...
* cpphash.h (struct definition): Move file, line, col members... (struct hashnode): ... here. Also add 'disabled' flag. (enum node_type): Add T_VOID, T_XCONST, T_FMACRO, and T_IDENTITY. Remove T_DISABLED. Update prototypes. * cpphash.c (_cpp_dump_definition): Split out dump_DEFINITION. (collect_expansion): Split into collect_objlike_expansion and collect_funlike_expansion. (_cpp_macroexpand): Split out scan_arguments, stringify, and funlike_macroexpand. (_cpp_compare_defs): Rename compare_defs, make static. (_cpp_make_hashnode): Initialize hp->disabled. (macro_cleanup): Adjust for new token types. Clear m->disabled. (_cpp_create_definition): Move code here to determine what sort of macro it is, and code to check for redefinitions, from do_define. Implement a few simple cases without creating a full DEFINITION. (_cpp_macroexpand, special_symbol, _cpp_dump_definition): Handle the simple cases. (push_macro_expansion): Set buf->has_escapes and hp->disabled here. * cppinit.c (builtin_array): Change MCONST to XCONST everywhere. * cpplex.c (maybe_macroexpand): Handle IDENTITY macros here; fix check for disabled and function-like macros. * cpplib.c (do_define): Move most logic to _cpp_create_definition. (do_undef): Handle new special token types. From-SVN: r33355
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 3e6a89f..f46b638 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -1455,7 +1455,7 @@ maybe_macroexpand (pfile, written)
if (!hp)
return 0;
- if (hp->type == T_DISABLED)
+ if (hp->disabled || hp->type == T_IDENTITY)
{
if (pfile->output_escapes)
{
@@ -1479,7 +1479,7 @@ maybe_macroexpand (pfile, written)
}
/* If macro wants an arglist, verify that a '(' follows. */
- if (hp->type == T_MACRO && hp->value.defn->nargs >= 0)
+ if (hp->type == T_FMACRO)
{
int macbuf_whitespace = 0;
int c;