Remove nested expressions
authorEtienne Bergeron <etienneb@google.com>
Thu, 4 Apr 2013 17:12:31 +0000 (13:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Apr 2013 17:12:31 +0000 (13:12 -0400)
Those are useless: the priorities are already known within the data
structure without those extra nodes.

Signed-off-by: Etienne Bergeron <etienneb@google.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-ast.h
formats/ctf/metadata/ctf-parser.y
formats/ctf/metadata/ctf-visitor-parent-links.c
formats/ctf/metadata/ctf-visitor-xml.c

index 20ed6cccba77f68f1b1d07ca4b8a36363e93d69e..4f4b8aba8938d5f103fb3be50dc24a53952e0355 100644 (file)
@@ -148,7 +148,6 @@ struct ctf_node {
                                UNARY_SIGNED_CONSTANT,
                                UNARY_UNSIGNED_CONSTANT,
                                UNARY_SBRAC,
                                UNARY_SIGNED_CONSTANT,
                                UNARY_UNSIGNED_CONSTANT,
                                UNARY_SBRAC,
-                               UNARY_NESTED,
                        } type;
                        union {
                                /*
                        } type;
                        union {
                                /*
@@ -159,7 +158,6 @@ struct ctf_node {
                                int64_t signed_constant;
                                uint64_t unsigned_constant;
                                struct ctf_node *sbrac_exp;
                                int64_t signed_constant;
                                uint64_t unsigned_constant;
                                struct ctf_node *sbrac_exp;
-                               struct ctf_node *nested_exp;
                        } u;
                        enum {
                                UNARY_LINK_UNKNOWN = 0,
                        } u;
                        enum {
                                UNARY_LINK_UNKNOWN = 0,
index 4d1017391cb0e30d20c755ad59f2215a6a89de04..1ccc718a0954ff063e72cefc7c3bd69b75ff6961 100644 (file)
@@ -1199,9 +1199,7 @@ postfix_expression:
                }
        |       LPAREN unary_expression RPAREN
                {
                }
        |       LPAREN unary_expression RPAREN
                {
-                       $$ = make_node(scanner, NODE_UNARY_EXPRESSION);
-                       $$->u.unary_expression.type = UNARY_NESTED;
-                       $$->u.unary_expression.u.nested_exp = $2;
+                       $$ = $2;
                }
        |       postfix_expression LSBRAC unary_expression RSBRAC
                {
                }
        |       postfix_expression LSBRAC unary_expression RSBRAC
                {
index 953727e84c3eccc809328f7f7ca6f82e8c7e0cc7..104afb717ddad5e78fb2dcbe87c9dabc0c0fb3eb 100644 (file)
@@ -69,13 +69,6 @@ int ctf_visitor_unary_expression(FILE *fd, int depth, struct ctf_node *node)
                if (ret)
                        return ret;
                break;
                if (ret)
                        return ret;
                break;
-       case UNARY_NESTED:
-               node->u.unary_expression.u.nested_exp->parent = node;
-               ret = ctf_visitor_unary_expression(fd, depth + 1,
-                       node->u.unary_expression.u.nested_exp);
-               if (ret)
-                       return ret;
-               break;
 
        case UNARY_UNKNOWN:
        default:
 
        case UNARY_UNKNOWN:
        default:
index 0276f836806fa8a1f97d7c03d8a22044adee0821..3c1d37e74827b7e1b7a7034361f7cd45330297b3 100644 (file)
@@ -104,16 +104,6 @@ int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *nod
                print_tabs(fd, depth);
                fprintf(fd, "</unary_expression_sbrac>\n");
                break;
                print_tabs(fd, depth);
                fprintf(fd, "</unary_expression_sbrac>\n");
                break;
-       case UNARY_NESTED:
-               print_tabs(fd, depth);
-               fprintf(fd, "<unary_expression_nested>\n");
-               ret = ctf_visitor_print_unary_expression(fd, depth + 1,
-                       node->u.unary_expression.u.nested_exp);
-               if (ret)
-                       return ret;
-               print_tabs(fd, depth);
-               fprintf(fd, "</unary_expression_nested>\n");
-               break;
 
        case UNARY_UNKNOWN:
        default:
 
        case UNARY_UNKNOWN:
        default:
This page took 0.026965 seconds and 4 git commands to generate.