Remove the unused STATEMENT_LOCAL_LABEL/struct local_label_statement_t. It never...
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 13 Dec 2008 09:46:45 +0000 (09:46 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 13 Dec 2008 09:46:45 +0000 (09:46 +0000)
[r24586]

ast.c
ast.h
ast2firm.c
ast_t.h
parser.c
walk_statements.c

diff --git a/ast.c b/ast.c
index 5910085..f09b346 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -999,25 +999,6 @@ static void print_case_label(const case_label_statement_t *statement)
        }
 }
 
-static void print_local_label(const local_label_statement_t *statement)
-{
-       fputs("__label__ ", out);
-
-       bool      first  = true;
-       entity_t *entity = statement->labels_begin;
-       for (;
-               entity != statement->labels_end->base.next;
-               entity = entity->base.next) {
-               if (!first) {
-                       fputs(", ", out);
-               } else {
-                       first = false;
-               }
-               fputs(entity->base.symbol->string, out);
-       }
-       fputs(";\n", out);
-}
-
 static void print_typedef(const entity_t *entity)
 {
        fputs("typedef ", out);
@@ -1272,9 +1253,6 @@ void print_statement(const statement_t *statement)
        case STATEMENT_LABEL:
                print_label_statement(&statement->label);
                break;
-       case STATEMENT_LOCAL_LABEL:
-               print_local_label(&statement->local_label);
-               break;
        case STATEMENT_GOTO:
                print_goto_statement(&statement->gotos);
                break;
@@ -1619,9 +1597,11 @@ void print_entity(const entity_t *entity)
        case ENTITY_NAMESPACE:
                print_namespace(&entity->namespacee);
                return;
+       case ENTITY_LOCAL_LABEL:
+               fprintf(out, "__label__ %s;", entity->base.symbol->string);
+               return;
        case ENTITY_LABEL:
        case ENTITY_ENUM_VALUE:
-       case ENTITY_LOCAL_LABEL:
                panic("print_entity used on unexpected entity type");
        case ENTITY_INVALID:
                break;
diff --git a/ast.h b/ast.h
index 3eda9ce..938181b 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -72,7 +72,6 @@ typedef struct return_statement_t           return_statement_t;
 typedef struct if_statement_t               if_statement_t;
 typedef struct switch_statement_t           switch_statement_t;
 typedef struct declaration_statement_t      declaration_statement_t;
-typedef struct local_label_statement_t      local_label_statement_t;
 typedef struct expression_statement_t       expression_statement_t;
 typedef struct goto_statement_t             goto_statement_t;
 typedef struct label_statement_t            label_statement_t;
index e17e97f..c30463c 100644 (file)
@@ -5115,10 +5115,6 @@ static void statement_to_firm(statement_t *statement)
        case STATEMENT_LABEL:
                label_to_firm(&statement->label);
                return;
-       case STATEMENT_LOCAL_LABEL:
-               /* local labels transform the semantics of labels while parsing
-                * they don't need any special treatment here */
-               return;
        case STATEMENT_GOTO:
                goto_to_firm(&statement->gotos);
                return;
diff --git a/ast_t.h b/ast_t.h
index f439064..2c32f85 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -533,7 +533,6 @@ typedef enum statement_kind_t {
        STATEMENT_COMPOUND,
        STATEMENT_RETURN,
        STATEMENT_DECLARATION,
-       STATEMENT_LOCAL_LABEL,
        STATEMENT_IF,
        STATEMENT_SWITCH,
        STATEMENT_EXPRESSION,
@@ -587,12 +586,6 @@ struct declaration_statement_t {
        entity_t         *declarations_end;
 };
 
-struct local_label_statement_t {
-       statement_base_t  base;
-       entity_t         *labels_begin;
-       entity_t         *labels_end;
-};
-
 struct if_statement_t {
        statement_base_t  base;
        expression_t     *condition;
@@ -701,7 +694,6 @@ union statement_t {
        return_statement_t       returns;
        compound_statement_t     compound;
        declaration_statement_t  declaration;
-       local_label_statement_t  local_label;
        if_statement_t           ifs;
        switch_statement_t       switchs;
        goto_statement_t         gotos;
index 733f878..8ccee85 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -381,7 +381,6 @@ static size_t get_statement_struct_size(statement_kind_t kind)
                [STATEMENT_COMPOUND]    = sizeof(compound_statement_t),
                [STATEMENT_RETURN]      = sizeof(return_statement_t),
                [STATEMENT_DECLARATION] = sizeof(declaration_statement_t),
-               [STATEMENT_LOCAL_LABEL] = sizeof(local_label_statement_t),
                [STATEMENT_IF]          = sizeof(if_statement_t),
                [STATEMENT_SWITCH]      = sizeof(switch_statement_t),
                [STATEMENT_EXPRESSION]  = sizeof(expression_statement_t),
@@ -5809,7 +5808,6 @@ static void check_reachable(statement_t *const stmt)
        switch (stmt->kind) {
                case STATEMENT_INVALID:
                case STATEMENT_EMPTY:
-               case STATEMENT_LOCAL_LABEL:
                case STATEMENT_ASM:
                        next = stmt->base.next;
                        break;
@@ -6088,7 +6086,6 @@ found_break_parent:
                        case STATEMENT_INVALID:
                        case STATEMENT_EMPTY:
                        case STATEMENT_DECLARATION:
-                       case STATEMENT_LOCAL_LABEL:
                        case STATEMENT_EXPRESSION:
                        case STATEMENT_ASM:
                        case STATEMENT_RETURN:
index a13a70f..ef3c549 100644 (file)
@@ -213,7 +213,6 @@ void walk_statements(statement_t *const stmt, statement_callback const callback,
                        walk_statements(stmt->ms_try.final_statement, callback, env);
                        return;
 
-               case STATEMENT_LOCAL_LABEL:
                case STATEMENT_INVALID:
                case STATEMENT_EMPTY:
                case STATEMENT_CONTINUE: