aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libcpp/traditional.c
diff options
context:
space:
mode:
authorYiran Wang <yiran@google.com>2015-06-23 15:33:17 -0700
committerYiran Wang <yiran@google.com>2015-06-29 10:56:28 -0700
commit1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch)
tree3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/libcpp/traditional.c
parentf378ebf14df0952eae870c9865bab8326aa8f137 (diff)
downloadtoolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/libcpp/traditional.c')
-rw-r--r--gcc-4.9/libcpp/traditional.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc-4.9/libcpp/traditional.c b/gcc-4.9/libcpp/traditional.c
index b770db7ab..dfb53787a 100644
--- a/gcc-4.9/libcpp/traditional.c
+++ b/gcc-4.9/libcpp/traditional.c
@@ -74,7 +74,9 @@ enum ls {ls_none = 0, /* Normal state. */
ls_defined_close, /* Looking for ')' of defined(). */
ls_hash, /* After # in preprocessor conditional. */
ls_predicate, /* After the predicate, maybe paren? */
- ls_answer}; /* In answer to predicate. */
+ ls_answer, /* In answer to predicate. */
+ ls_has_include, /* After __has_include__. */
+ ls_has_include_close}; /* Looking for ')' of __has_include__. */
/* Lexing TODO: Maybe handle space in escaped newlines. Stop lex.c
from recognizing comments and directives during its lexing pass. */
@@ -524,6 +526,13 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
lex_state = ls_defined;
continue;
}
+ else if (pfile->state.in_expression
+ && (node == pfile->spec_nodes.n__has_include__
+ || node == pfile->spec_nodes.n__has_include_next__))
+ {
+ lex_state = ls_has_include;
+ continue;
+ }
}
break;
@@ -547,6 +556,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
lex_state = ls_answer;
else if (lex_state == ls_defined)
lex_state = ls_defined_close;
+ else if (lex_state == ls_has_include)
+ lex_state = ls_has_include_close;
}
break;
@@ -584,7 +595,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
goto new_context;
}
}
- else if (lex_state == ls_answer || lex_state == ls_defined_close)
+ else if (lex_state == ls_answer || lex_state == ls_defined_close
+ || lex_state == ls_has_include_close)
lex_state = ls_none;
}
break;
@@ -665,7 +677,8 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
lex_state = ls_none;
else if (lex_state == ls_hash
|| lex_state == ls_predicate
- || lex_state == ls_defined)
+ || lex_state == ls_defined
+ || lex_state == ls_has_include)
lex_state = ls_none;
/* ls_answer and ls_defined_close keep going until ')'. */