parser: Remove the unused attribute alignment from struct declaration_specifiers_t.
[cparser] / ast2firm.c
index 3cc2db0..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"
@@ -235,12 +235,6 @@ static void init_atomic_modes(void)
        }
 }
 
-ir_mode *get_atomic_mode(atomic_type_kind_t kind)
-{
-       assert(kind <= ATOMIC_TYPE_LAST);
-       return atomic_modes[kind];
-}
-
 static ir_node *get_vla_size(array_type_t *const type)
 {
        ir_node *size_node = type->size_node;
@@ -334,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);
@@ -680,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);
 
@@ -2204,15 +2200,15 @@ static ir_node *handle_assume(expression_t const *const expr)
 
 static ir_node *create_cast(unary_expression_t const *const expr)
 {
-       type_t *const type = skip_typeref(expr->base.type);
-       if (is_type_void(type))
-               return NULL;
-
        type_t  *const from_type = skip_typeref(expr->value->base.type);
        ir_node       *value     = is_type_complex(from_type)
                ? expression_to_complex(expr->value).real
                : expression_to_value(expr->value);
 
+       type_t *const type = skip_typeref(expr->base.type);
+       if (is_type_void(type))
+               return NULL;
+
        dbg_info *const dbgi = get_dbg_info(&expr->base.pos);
        ir_mode  *const mode = get_ir_mode_storage(type);
        /* check for conversion from / to __based types */
@@ -5899,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;