#include "ctrump/ast/abi.h"
#include "ctrump/ast/types.h"
#include "ctrump/common/abort.h"
#include <stdlib.h>
#include <assert.h>
Go to the source code of this file.
Defines | |
#define | CHECK_ERROR(e) |
Functions | |
static int | calc_union_size (size_t *size, size_t *align, const struct ctrump_abi *abi, const struct ctrump_record_type *u) |
unionのサイズを求める メンバのうちで一番大きなsize, alignを求める | |
static int | align_ceil (int val, int align_to) |
static int | record_field_offset (int *offset_ret, int *max_align_ret, struct ctrump_record_type_field *f, const struct ctrump_abi *abi) |
構造体フィールドのオフセットを求める | |
static int | calc_struct_size (size_t *size, size_t *align, const struct ctrump_abi *abi, const struct ctrump_record_type *s) |
構造体のサイズを求める | |
int | ctrump_texpr_size (size_t *size, size_t *align, const struct ctrump_abi *abi, const struct ctrump_texpr *type) |
型のサイズを求める | |
int | ctrump_is_bitconvertion_on_type_conversion (const struct ctrump_texpr *convert_to, const struct ctrump_texpr *convert_from, const struct ctrump_abi *abi) |
convert_from から convert_to への変換で ビットレベルでのなんらかの変換が起こるかどうかを求める | |
int | ctrump_struct_field_offset (const struct ctrump_record_type *record, const struct ctrump_symbol *field_tag, const struct ctrump_abi *abi) |
構造体のメンバの先頭からのオフセットを求める | |
Variables | |
struct ctrump_abi | ctrump_spu_abi |
SPU Application Binary Interface Specification 1.5.1. | |
struct ctrump_abi | ctrump_ppc32_abi |
??(from some test code) | |
struct ctrump_abi | ctrump_ppc64_abi |
??(from some test code) | |
struct ctrump_abi | ctrump_x86_abi |
??(from some test code) | |
struct ctrump_abi | ctrump_x86LP64_abi |
System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99. |
Definition in file abi.c.
#define CHECK_ERROR | ( | e | ) |
static int align_ceil | ( | int | val, | |
int | align_to | |||
) | [static] |
static int calc_struct_size | ( | size_t * | size, | |
size_t * | align, | |||
const struct ctrump_abi * | abi, | |||
const struct ctrump_record_type * | s | |||
) | [static] |
構造体のサイズを求める
Definition at line 301 of file abi.c.
References align_ceil(), ctrump_gccext_attribute::aligned, ctrump_record_type::attr, CTRUMP_ALIGN_UNSPECIFIED, f(), ctrump_record_type::fields, ctrump_record_type::is_completed, ctrump_record_type::nfield, OffloadSpe::offset, and record_field_offset().
Referenced by ctrump_texpr_size().
static int calc_union_size | ( | size_t * | size, | |
size_t * | align, | |||
const struct ctrump_abi * | abi, | |||
const struct ctrump_record_type * | u | |||
) | [static] |
unionのサイズを求める メンバのうちで一番大きなsize, alignを求める
Definition at line 217 of file abi.c.
References CHECK_ERROR, ctrump_texpr_size(), f(), ctrump_record_type::fields, ctrump_record_type::is_completed, OffloadSpe::max_size, ctrump_record_type::nfield, and ctrump_record_type_field::type.
Referenced by ctrump_texpr_size().
int ctrump_is_bitconvertion_on_type_conversion | ( | const struct ctrump_texpr * | convert_to, | |
const struct ctrump_texpr * | convert_from, | |||
const struct ctrump_abi * | abi | |||
) |
convert_from から convert_to への変換で ビットレベルでのなんらかの変換が起こるかどうかを求める
Definition at line 468 of file abi.c.
References ctrump_texpr_size(), ctrump_type_is_float(), and ctrump_type_is_scalar().
Referenced by ctrump_peel_bitequality_cast_expr().
int ctrump_struct_field_offset | ( | const struct ctrump_record_type * | record, | |
const struct ctrump_symbol * | field_tag, | |||
const struct ctrump_abi * | abi | |||
) |
構造体のメンバの先頭からのオフセットを求める
Definition at line 493 of file abi.c.
References f(), ctrump_record_type::fields, ctrump_record_type::is_completed, ctrump_record_type_field::name, ctrump_record_type::nfield, OffloadSpe::offset, and record_field_offset().
Referenced by struct_field_offset().
int ctrump_texpr_size | ( | size_t * | size, | |
size_t * | align, | |||
const struct ctrump_abi * | abi, | |||
const struct ctrump_texpr * | type | |||
) |
型のサイズを求める
Definition at line 333 of file abi.c.
References ctrump_gccext_attribute::aligned, ctrump_abi::alignof_bool, ctrump_abi::alignof_double, ctrump_abi::alignof_enum, ctrump_abi::alignof_float, ctrump_abi::alignof_int, ctrump_abi::alignof_long, ctrump_abi::alignof_long_double, ctrump_abi::alignof_longlong, ctrump_abi::alignof_pointer, ctrump_abi::alignof_short, ctrump_abi::alignof_vector, ctrump_texpr::array, ctrump_array_type::array_of, ctrump_qualified_type::attr, ctrump_texpr::builtin, calc_struct_size(), calc_union_size(), CHECK_ERROR, ctrump_builtin_type::code, ctrump_texpr::code, CTRUMP_BOOL, CTRUMP_CHAR, CTRUMP_DOUBLE, CTRUMP_FLOAT, CTRUMP_LONG_DOUBLE, CTRUMP_SCHAR, CTRUMP_SINT, CTRUMP_SLONG, CTRUMP_SLONGLONG, CTRUMP_SSHORT, ctrump_texpr_size(), CTRUMP_TYPE_ARRAY, CTRUMP_TYPE_BUILTIN, CTRUMP_TYPE_ENUM, CTRUMP_TYPE_FUNC, CTRUMP_TYPE_INCOMPLETE_ARRAY, CTRUMP_TYPE_POINTER, CTRUMP_TYPE_QUALIFIED, CTRUMP_TYPE_STRUCT, CTRUMP_TYPE_TYPEDEF_NAME, CTRUMP_TYPE_UNION, CTRUMP_TYPE_VARLEN_ARRAY, CTRUMP_UCHAR, CTRUMP_UINT, CTRUMP_ULONG, CTRUMP_ULONGLONG, ctrump_unreachable, CTRUMP_USHORT, CTRUMP_VEC_DOUBLE, CTRUMP_VEC_FLOAT, CTRUMP_VEC_SCHAR, CTRUMP_VEC_SINT, CTRUMP_VEC_SLONG, CTRUMP_VEC_SLONGLONG, CTRUMP_VEC_SSHORT, CTRUMP_VEC_UCHAR, CTRUMP_VEC_UINT, CTRUMP_VEC_ULONG, CTRUMP_VEC_ULONGLONG, CTRUMP_VEC_USHORT, CTRUMP_VOID, ctrump_typedef_name::defined_to, ctrump_texpr::qualified, ctrump_array_type::size, ctrump_abi::sizeof_bool, ctrump_abi::sizeof_double, ctrump_abi::sizeof_enum, ctrump_abi::sizeof_float, ctrump_abi::sizeof_int, ctrump_abi::sizeof_long, ctrump_abi::sizeof_long_double, ctrump_abi::sizeof_longlong, ctrump_abi::sizeof_pointer, ctrump_abi::sizeof_short, ctrump_abi::sizeof_vector, ctrump_texpr::typedef_name, ctrump_texpr::u, ctrump_texpr::union_, and ctrump_qualified_type::unqualified_type.
Referenced by calc_type_size(), calc_union_size(), ctrump_is_bitconvertion_on_type_conversion(), ctrump_texpr_size(), and record_field_offset().
static int record_field_offset | ( | int * | offset_ret, | |
int * | max_align_ret, | |||
struct ctrump_record_type_field * | f, | |||
const struct ctrump_abi * | abi | |||
) | [static] |
構造体フィールドのオフセットを求める
Definition at line 261 of file abi.c.
References align_ceil(), CHECK_ERROR, CTRUMP_ALIGN_UNSPECIFIED, ctrump_texpr_size(), OffloadSpe::offset, and ctrump_record_type_field::type.
Referenced by calc_struct_size(), and ctrump_struct_field_offset().
struct ctrump_abi ctrump_ppc32_abi |
Initial value:
{ .sizeof_pointer = 4, .sizeof_long = 4, .sizeof_int = 4, .sizeof_enum = 4, .sizeof_short = 2, .sizeof_bool = 1, .sizeof_longlong = 8, .sizeof_float = 4, .sizeof_double = 8, .sizeof_long_double = 16, .sizeof_vector = 16, .alignof_pointer = 4, .alignof_long = 4, .alignof_int = 4, .alignof_enum = 4, .alignof_short = 2, .alignof_bool = 1, .alignof_longlong = 8, .alignof_float = 4, .alignof_double = 8, .alignof_long_double = 16, .alignof_vector = 16, .is_char_signed = 0, }
Definition at line 76 of file abi.c.
Referenced by cfront_parse(), ctrump_indent(), and ctrump_prog_file2pprint_format().
struct ctrump_abi ctrump_ppc64_abi |
Initial value:
{ .sizeof_pointer = 8, .sizeof_long = 8, .sizeof_int = 4, .sizeof_enum = 4, .sizeof_short = 2, .sizeof_bool = 1, .sizeof_longlong = 8, .sizeof_float = 4, .sizeof_double = 8, .sizeof_long_double = 16, .sizeof_vector = 16, .alignof_pointer = 8, .alignof_long = 8, .alignof_int = 4, .alignof_enum = 4, .alignof_short = 2, .alignof_bool = 1, .alignof_longlong = 8, .alignof_float = 4, .alignof_double = 8, .alignof_long_double = 16, .alignof_vector = 16, .is_char_signed = 0, }
struct ctrump_abi ctrump_spu_abi |
Initial value:
{ .sizeof_pointer = 4, .sizeof_long = 4, .sizeof_int = 4, .sizeof_enum = 4, .sizeof_short = 2, .sizeof_bool = 1, .sizeof_longlong = 8, .sizeof_float = 4, .sizeof_double = 8, .sizeof_long_double = 8, .sizeof_vector = 16, .alignof_pointer = 4, .alignof_long = 4, .alignof_int = 4, .alignof_enum = 4, .alignof_short = 2, .alignof_bool = 1, .alignof_longlong = 8, .alignof_float = 4, .alignof_double = 8, .alignof_long_double = 8, .alignof_vector = 16, .is_char_signed = 0, }
struct ctrump_abi ctrump_x86_abi |
Initial value:
{ .sizeof_pointer = 4, .sizeof_long = 4, .sizeof_int = 4, .sizeof_enum = 4, .sizeof_short = 2, .sizeof_bool = 1, .sizeof_longlong = 8, .sizeof_float = 4, .sizeof_double = 8, .sizeof_long_double = 12, .sizeof_vector = 16, .alignof_pointer = 4, .alignof_long = 4, .alignof_int = 4, .alignof_enum = 4, .alignof_short = 2, .alignof_bool = 1, .alignof_longlong = 8, .alignof_float = 4, .alignof_double = 8, .alignof_long_double = 12, .alignof_vector = 16, .is_char_signed = 1, }
struct ctrump_abi ctrump_x86LP64_abi |
Initial value:
{ .sizeof_pointer = 8, .sizeof_long = 8, .sizeof_int = 4, .sizeof_enum = 4, .sizeof_short = 2, .sizeof_bool = 1, .sizeof_longlong = 8, .sizeof_float = 4, .sizeof_double = 8, .sizeof_long_double = 16, .sizeof_vector = 16, .alignof_pointer = 8, .alignof_long = 8, .alignof_int = 4, .alignof_enum = 4, .alignof_short = 2, .alignof_bool = 1, .alignof_longlong = 8, .alignof_float = 4, .alignof_double = 8, .alignof_long_double = 16, .alignof_vector = 16, .is_char_signed = 1, }