diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2000-03-31 23:16:11 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-03-31 23:16:11 +0000 |
commit | ae79697b721b607964d32468c87d1881c3a39974 (patch) | |
tree | c407bb10c858c1ee81576f79ea01d3e9c8890316 /gcc/cpphash.c | |
parent | 7bde2862db58ec0828e26fc95768f6d008a97f6f (diff) | |
download | gcc-ae79697b721b607964d32468c87d1881c3a39974.zip gcc-ae79697b721b607964d32468c87d1881c3a39974.tar.gz gcc-ae79697b721b607964d32468c87d1881c3a39974.tar.bz2 |
cpplib.h: Merge struct cpp_options into struct cpp_reader.
* cpplib.h: Merge struct cpp_options into struct cpp_reader.
Reorder struct cpp_options and struct cpp_reader for better
packing. Replace CPP_OPTIONS macro with CPP_OPTION which
takes two args. Change all 'char' flags to 'unsigned char'.
Move show_column flag into struct cpp_options. Don't
prototype cpp_options_init.
* cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c,
cppinit.c, cpplex.c, cpplib.c:
Replace CPP_OPTIONS (pfile)->whatever with
CPP_OPTION (pfile, whatever), and likewise for
opts = CPP_OPTIONS (pfile); ... opts->whatever;
* cppinit.c (merge_include_chains): Take a cpp_reader *.
Extract CPP_OPTION (pfile, pending) and work with that
directly.
(cpp_options_init): Delete.
(cpp_reader_init): Turn on on-by-default options here.
Allocate the pending structure here.
(cl_options, enum opt_code): Define these from the same table,
kept in a large macro. Add -fshow-column and -fno-show-column
options.
* cpperror.c (v_message): If show_column is off, don't print
the column number.
* cppmain.c: Update for new interface.
* fix-header.c: Likewise.
From-SVN: r32850
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r-- | gcc/cpphash.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c index f0f1319..998ebe6 100644 --- a/gcc/cpphash.c +++ b/gcc/cpphash.c @@ -406,7 +406,7 @@ collect_expansion (pfile, arglist) if (last_token == STRIZE) cpp_error (pfile, "`#' is not followed by a macro argument name"); - if (CPP_TRADITIONAL (pfile) || CPP_OPTIONS (pfile)->warn_stringify) + if (CPP_TRADITIONAL (pfile) || CPP_OPTION (pfile, warn_stringify)) goto maybe_trad_stringify; else goto norm; @@ -480,7 +480,7 @@ collect_expansion (pfile, arglist) (int) argv[i].len, argv[i].name); continue; } - if (CPP_OPTIONS (pfile)->warn_stringify) + if (CPP_OPTION (pfile, warn_stringify)) cpp_warning (pfile, "macro argument `%.*s' is stringified", (int) argv[i].len, argv[i].name); @@ -614,7 +614,7 @@ collect_formal_parameters (pfile) cpp_error (pfile, "duplicate macro argument name `%s'", tok); continue; } - if (CPP_PEDANTIC (pfile) && CPP_OPTIONS (pfile)->c99 + if (CPP_PEDANTIC (pfile) && CPP_OPTION (pfile, c99) && len == sizeof "__VA_ARGS__" - 1 && !strncmp (tok, "__VA_ARGS__", len)) cpp_pedwarn (pfile, @@ -661,7 +661,7 @@ collect_formal_parameters (pfile) those elsewhere. */ if (argv[argc].len == 0) { - if (CPP_PEDANTIC (pfile) && ! CPP_OPTIONS (pfile)->c99) + if (CPP_PEDANTIC (pfile) && ! CPP_OPTION (pfile, c99)) cpp_pedwarn (pfile, "C89 does not permit varargs macros"); len = sizeof "__VA_ARGS__" - 1; @@ -740,8 +740,8 @@ _cpp_create_definition (pfile, funlike) pfile->no_macro_expand++; pfile->parsing_define_directive++; - CPP_OPTIONS (pfile)->discard_comments++; - CPP_OPTIONS (pfile)->no_line_commands++; + CPP_OPTION (pfile, discard_comments)++; + CPP_OPTION (pfile, no_line_commands)++; if (funlike) { @@ -760,15 +760,15 @@ _cpp_create_definition (pfile, funlike) pfile->no_macro_expand--; pfile->parsing_define_directive--; - CPP_OPTIONS (pfile)->discard_comments--; - CPP_OPTIONS (pfile)->no_line_commands--; + CPP_OPTION (pfile, discard_comments)--; + CPP_OPTION (pfile, no_line_commands)--; return defn; err: pfile->no_macro_expand--; pfile->parsing_define_directive--; - CPP_OPTIONS (pfile)->discard_comments--; - CPP_OPTIONS (pfile)->no_line_commands--; + CPP_OPTION (pfile, discard_comments)--; + CPP_OPTION (pfile, no_line_commands)--; return 0; } @@ -1069,8 +1069,8 @@ _cpp_macroexpand (pfile, hp) rest_args = 0; /* Skip over the opening parenthesis. */ - CPP_OPTIONS (pfile)->discard_comments++; - CPP_OPTIONS (pfile)->no_line_commands++; + CPP_OPTION (pfile, discard_comments)++; + CPP_OPTION (pfile, no_line_commands)++; pfile->no_macro_expand++; pfile->no_directives++; @@ -1102,8 +1102,8 @@ _cpp_macroexpand (pfile, hp) i++; } while (token == CPP_COMMA); - CPP_OPTIONS (pfile)->discard_comments--; - CPP_OPTIONS (pfile)->no_line_commands--; + CPP_OPTION (pfile, discard_comments)--; + CPP_OPTION (pfile, no_line_commands)--; pfile->no_macro_expand--; pfile->no_directives--; if (token != CPP_RPAREN) @@ -1457,7 +1457,7 @@ unsafe_chars (pfile, c1, c2) goto letter; case '$': - if (CPP_OPTIONS (pfile)->dollars_in_ident) + if (CPP_OPTION (pfile, dollars_in_ident)) goto letter; return 0; |