aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-11-13 18:40:37 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-11-13 18:40:37 +0000
commit29b10746ab46f5901534d712d6108f219aceff97 (patch)
tree6bca53154943312d4ce1d3788de1f631c994d6c8 /gcc/cpplex.c
parenteb68ad7c6025a667e77ea59e85ab37612e4593de (diff)
downloadgcc-29b10746ab46f5901534d712d6108f219aceff97.zip
gcc-29b10746ab46f5901534d712d6108f219aceff97.tar.gz
gcc-29b10746ab46f5901534d712d6108f219aceff97.tar.bz2
cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF cases return without MI check.
* cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF cases return without MI check. * cpplib.c (do_diagnostic): Take boolean of whether to print the directive name. (do_error, do_warning): Update. (do_pragma_dependency): Use it. * cpplib.h (VARARGS_FIRST): Delete. (struct cpp_token): Delete integer. * cppmacro.c (enter_macro_context): Move disabled check to _cpp_get_token. (_cpp_get_token): Simplify into a single loop. From-SVN: r37434
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 75d094d..8717104 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -876,7 +876,8 @@ _cpp_lex_token (pfile, result)
pfile->state.next_bol = 1;
pfile->skipping = 0; /* In case missing #endif. */
result->type = CPP_EOF;
- break;
+ /* Don't do MI optimisation. */
+ return;
case ' ': case '\t': case '\f': case '\v': case '\0':
skip_whitespace (pfile, c);
@@ -1032,7 +1033,8 @@ _cpp_lex_token (pfile, result)
/* Save the comment as a token in its own right. */
save_comment (pfile, result, comment_start);
- break;
+ /* Don't do MI optimisation. */
+ return;
case '<':
if (pfile->state.angled_headers)
@@ -1272,10 +1274,8 @@ _cpp_lex_token (pfile, result)
break;
}
- /* Non-comment tokens invalidate any controlling macros. */
- if (result->type != CPP_COMMENT
- && result->type != CPP_EOF
- && !pfile->state.in_directive)
+ /* If not in a directive, this token invalidates controlling macros. */
+ if (!pfile->state.in_directive)
pfile->mi_state = MI_FAILED;
}