diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-11 05:20:08 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-11 05:20:08 +0000 |
commit | 9dd72ec43737ca9d1ec49315d4a5e0fdd3d578f2 (patch) | |
tree | 9f2ed3c3628913b10a211d8bef542c2772bafa97 /gcc/cp/cp-tree.def | |
parent | 41b45702e37640cb19b88ab0f8c335faf38025f0 (diff) | |
download | gcc-9dd72ec43737ca9d1ec49315d4a5e0fdd3d578f2.tar.gz |
Implement range-based for-statements.
* cp-tree.def (RANGE_FOR_STMT): New.
* cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
(cp_convert_range_for): Declare.
* pt.c (tsubst_expr): Add RANGE_FOR_STMT.
(tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
* semantics.c (begin_range_for_stmt): New.
(finish_range_for_decl): New.
(finish_for_stmt): Accept also RANGE_FOR_STMT.
(perform_koenig_lookup): Add extra argument include_std.
* parser.c (cp_parser_c_for): New with code from
cp_parser_iteration_statement().
(cp_parser_range_for): New.
(cp_convert_range_for): New.
(cp_parser_iteration_statement): Add range-for support.
(cp_parser_condition): Adjust comment.
(cp_parser_postfix_expression): perform_koenig_lookup takes extra
argument.
* dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
* cxx-pretty-print.c: Likewise.
* lex.c (cxx_init): Likewise.
* name-lookup.c (lookup_function_nonclass): Add extra argument
include_std.
(lookup_arg_dependent): Likewise.
* name-lookup.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164211 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.def')
-rw-r--r-- | gcc/cp/cp-tree.def | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index b77350fffa8..1eb25c31a7d 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -293,6 +293,11 @@ DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 4) +/* Used to represent a range-based `for' statement. The operands are + RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY, respectively. Only used + in templates. */ +DEFTREECODE (RANGE_FOR_STMT, "range_for_stmt", tcc_statement, 3) + /* Used to represent a 'while' statement. The operands are WHILE_COND and WHILE_BODY, respectively. */ DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) |