#include <string.h>
#include <stdbool.h>
#include <unistd.h>
-#include <limits.h>
#include <libfirm/firm.h>
#include <libfirm/adt/obst.h>
#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"
#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"
}
}
-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;
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);
}
}
-ir_type *get_ir_type(type_t *type)
+static ir_type *get_ir_type(type_t *type)
{
type = skip_typeref(type);
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 */
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;