Remove the unnecessary distinction between compound_t structe and compound_t unione...
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 19 May 2011 06:33:00 +0000 (08:33 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 19 May 2011 06:33:00 +0000 (08:33 +0200)
Its only use was causing code duplication in the AST printer anyway.
Everybody else already uses compound.

ast.c
entity_t.h

diff --git a/ast.c b/ast.c
index af2a2d3..f34668b 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1478,19 +1478,14 @@ void print_entity(const entity_t *entity)
                return;
        case ENTITY_STRUCT:
                print_string("struct ");
-               print_string(entity->base.symbol->string);
-               if (entity->structe.complete) {
-                       print_string(" ");
-                       print_compound_definition(&entity->structe);
-               }
-               print_string(";");
-               return;
+               goto print_compound;
        case ENTITY_UNION:
                print_string("union ");
+print_compound:
                print_string(entity->base.symbol->string);
-               if (entity->unione.complete) {
+               if (entity->compound.complete) {
                        print_string(" ");
-                       print_compound_definition(&entity->unione);
+                       print_compound_definition(&entity->compound);
                }
                print_string(";");
                return;
index d6d3702..1af1ce9 100644 (file)
@@ -263,8 +263,6 @@ struct function_t {
 union entity_t {
        entity_kind_t      kind;
        entity_base_t      base;
-       compound_t         structe;
-       compound_t         unione;
        compound_t         compound;
        enum_t             enume;
        enum_value_t       enum_value;