diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2015-03-06 21:58:31 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2015-03-06 21:58:31 +0000 |
commit | a78cbe2976549780489d72b895a9adb528ba874b (patch) | |
tree | f1d880c44543fe81b7b7e8276b95504d04db5e51 /gcc | |
parent | 3ffa78014eb78d71951cddbd1ec1b8930011f2be (diff) | |
download | gcc-a78cbe2976549780489d72b895a9adb528ba874b.zip gcc-a78cbe2976549780489d72b895a9adb528ba874b.tar.gz gcc-a78cbe2976549780489d72b895a9adb528ba874b.tar.bz2 |
ptree.c (cxx_print_lambda_node): New.
* ptree.c (cxx_print_lambda_node): New.
(cxx_print_xnode): Handle LAMBDA_EXPR.
From-SVN: r221249
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/ptree.c | 31 |
2 files changed, 36 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3858590..1e19d6d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-06 Aldy Hernandez <aldyh@redhat.com> + + * ptree.c (cxx_print_lambda_node): New. + (cxx_print_xnode): Handle LAMBDA_EXPR. + 2015-03-03 Aldy Hernandez <aldyh@redhat.com> PR c++/65295 diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index 79c80a3..2d0b584 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -204,6 +204,34 @@ cxx_print_identifier (FILE *file, tree node, int indent) } void +cxx_print_lambda_node (FILE *file, tree node, int indent) +{ + if (LAMBDA_EXPR_MUTABLE_P (node)) + fprintf (file, " /mutable"); + fprintf (file, " default_capture_mode=["); + switch (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (node)) + { + case CPLD_NONE: + fprintf (file, "NONE"); + break; + case CPLD_COPY: + fprintf (file, "COPY"); + break; + case CPLD_REFERENCE: + fprintf (file, "CPLD_REFERENCE"); + break; + default: + fprintf (file, "??"); + break; + } + fprintf (file, "] "); + print_node (file, "capture_list", LAMBDA_EXPR_CAPTURE_LIST (node), indent + 4); + print_node (file, "this_capture", LAMBDA_EXPR_THIS_CAPTURE (node), indent + 4); + print_node (file, "return_type", LAMBDA_EXPR_RETURN_TYPE (node), indent + 4); + print_node (file, "closure", LAMBDA_EXPR_CLOSURE (node), indent + 4); +} + +void cxx_print_xnode (FILE *file, tree node, int indent) { switch (TREE_CODE (node)) @@ -243,6 +271,9 @@ cxx_print_xnode (FILE *file, tree node, int indent) print_node (file, "pattern", DEFERRED_NOEXCEPT_PATTERN (node), indent+4); print_node (file, "args", DEFERRED_NOEXCEPT_ARGS (node), indent+4); break; + case LAMBDA_EXPR: + cxx_print_lambda_node (file, node, indent); + break; default: break; } |