From b66377c173ecd444f4fb4f9737ee10a97084ad9a Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Thu, 13 Jun 2002 21:16:00 +0000 Subject: cpphash.h (_cpp_lex_identifier_trad): Remove. * cpphash.h (_cpp_lex_identifier_trad): Remove. * cpplib.c (end_directive): Don't skip, always remove overlay apart from #define. (prepare_directive_trad): Handle NULL pfile->directive. (_cpp_handle_directive): Always call prepare_directive_trad if traditional. * cppmain.c (check_multiline_token): Rename account_for_newlines, generalize inputs. (scan_translation_unit_trad): Use it. * cpptrad.c (skip_comment): Rename copy_comment, copy comment to output, get escaped newline in comment close correct. (check_output_buffer, skip_whitespace): Update. (_cpp_lex_identifier_trad): Remove. (scan_out_logical_line): Handle -C and comments in directives properly. From-SVN: r54599 --- gcc/cpplib.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'gcc/cpplib.c') diff --git a/gcc/cpplib.c b/gcc/cpplib.c index acc71e7..aecfbaf 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -256,14 +256,11 @@ end_directive (pfile, skip_line) { if (CPP_OPTION (pfile, traditional)) { - if (!pfile->directive || pfile->directive == &dtable[T_DEFINE]) - skip_line = false; - else + if (pfile->directive != &dtable[T_DEFINE]) _cpp_remove_overlay (pfile); } - /* We don't skip for an assembler #. */ - if (skip_line) + else if (skip_line) { skip_rest_of_line (pfile); if (!pfile->keep_tokens) @@ -289,7 +286,8 @@ prepare_directive_trad (pfile) CUR (pfile->context) = pfile->buffer->cur; else { - bool no_expand = ! (pfile->directive->flags & EXPAND); + bool no_expand = (pfile->directive + && ! (pfile->directive->flags & EXPAND)); bool was_skipping = pfile->state.skipping; pfile->state.skipping = false; @@ -382,6 +380,10 @@ _cpp_handle_directive (pfile, indented) "style of line directive is a GCC extension"); } + pfile->directive = dir; + if (CPP_OPTION (pfile, traditional)) + prepare_directive_trad (pfile); + if (dir) { /* If we have a directive that is not an opening conditional, @@ -441,9 +443,6 @@ _cpp_handle_directive (pfile, indented) pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments_in_macro_exp); - pfile->directive = dir; - if (CPP_OPTION (pfile, traditional)) - prepare_directive_trad (pfile); (*pfile->directive->handler) (pfile); } else if (skip == 0) -- cgit v1.1