parser: Remove the unused attribute alignment from struct declaration_specifiers_t.
[cparser] / ast2firm.c
index 7790c60..5510444 100644 (file)
@@ -8,7 +8,6 @@
 #include <string.h>
 #include <stdbool.h>
 #include <unistd.h>
-#include <limits.h>
 
 #include <libfirm/firm.h>
 #include <libfirm/adt/obst.h>
@@ -22,6 +21,7 @@
 #include "adt/util.h"
 #include "jump_target.h"
 #include "symbol_t.h"
+#include "symbol_table.h"
 #include "token_t.h"
 #include "type_t.h"
 #include "ast_t.h"
@@ -30,8 +30,8 @@
 #include "diagnostic.h"
 #include "lang_features.h"
 #include "types.h"
-#include "type_hash.h"
 #include "mangle.h"
+#include "unicode.h"
 #include "walk.h"
 #include "warning.h"
 #include "printer.h"
@@ -328,6 +328,8 @@ static type_t *get_parameter_type(type_t *orig_type)
        return type;
 }
 
+static ir_type *get_ir_type(type_t *type);
+
 static ir_type *create_method_type(const function_type_t *function_type, bool for_closure)
 {
        type_t        *return_type  = skip_typeref(function_type->return_type);
@@ -674,7 +676,7 @@ static ir_type *get_ir_type_incomplete(type_t *type)
        }
 }
 
-ir_type *get_ir_type(type_t *type)
+static ir_type *get_ir_type(type_t *type)
 {
        type = skip_typeref(type);
 
@@ -5893,32 +5895,6 @@ static void create_function(entity_t *entity)
 
        irg_finalize_cons(irg);
 
-       /* finalize the frame type */
-       ir_type *frame_type = get_irg_frame_type(irg);
-       int      n          = get_compound_n_members(frame_type);
-       int      align_all  = 4;
-       int      offset     = 0;
-       for (int i = 0; i < n; ++i) {
-               ir_entity *member      = get_compound_member(frame_type, i);
-               ir_type   *entity_type = get_entity_type(member);
-
-               int align = get_type_alignment_bytes(entity_type);
-               if (align > align_all)
-                       align_all = align;
-               int misalign = 0;
-               if (align > 0) {
-                       misalign  = offset % align;
-                       if (misalign > 0) {
-                               offset += align - misalign;
-                       }
-               }
-
-               set_entity_offset(member, offset);
-               offset += get_type_size_bytes(entity_type);
-       }
-       set_type_size_bytes(frame_type, offset);
-       set_type_alignment_bytes(frame_type, align_all);
-
        irg_verify(irg, VERIFY_ENFORCE_SSA);
        current_vararg_entity = old_current_vararg_entity;
        current_function      = old_current_function;