libFirm
Loading...
Searching...
No Matches
target.h
1/*
2 * This file is part of libFirm.
3 * Copyright (C) 2017 Matthias Braun <matze@braunis.de>
4 */
5#ifndef FIRM_TARGET_H
6#define FIRM_TARGET_H
7
8#include "firm_types.h"
9
10#include "begin.h"
11
24FIRM_API int ir_target_set(const char *target_triple);
25
32FIRM_API int ir_target_set_triple(ir_machine_triple_t const *machine);
33
54FIRM_API int ir_target_option(char const *option);
55
62FIRM_API void ir_target_init(void);
63
65FIRM_API char const *ir_target_experimental(void);
66
68FIRM_API int ir_target_big_endian(void);
69
71FIRM_API unsigned ir_target_biggest_alignment(void);
72
74FIRM_API unsigned ir_target_pointer_size(void);
75
77FIRM_API int ir_target_supports_pic(void);
78
84
92
98FIRM_API float_int_conversion_overflow_style_t ir_target_float_int_overflow_style(void);
99
131
133
142
144FIRM_API int ir_platform_pic_is_default(void);
145
150
155FIRM_API char const *ir_platform_define_value(
156 ir_platform_define_t const *define);
157
164
167
170
173
176
178FIRM_API ir_mode *ir_platform_type_mode(ir_platform_type_t type, int is_signed);
179
185
188
190FIRM_API char const *ir_platform_default_exe_name(void);
191
196FIRM_API ident *ir_platform_mangle_global(char const *name);
197
200
206 ir_platform_define_t const *define);
207
209FIRM_API char const *ir_platform_define_name(
210 ir_platform_define_t const *define);
211
262 const char *triple_string);
263
269
271FIRM_API const char *ir_triple_get_cpu_type(const ir_machine_triple_t *triple);
272
274FIRM_API const char *ir_triple_get_manufacturer(
275 const ir_machine_triple_t *triple);
276
279 const ir_machine_triple_t *triple);
280
283 const char *cpu_type);
284
287
292#include "end.h"
293
294#endif
const char ident
Identifier.
Definition firm_types.h:50
struct ir_mode ir_mode
SSA Value mode.
Definition firm_types.h:59
ir_mode * ir_target_float_arithmetic_mode(void)
Returns supported float arithmetic mode or NULL if mode_D and mode_F are supported natively.
char const * ir_target_experimental(void)
Returns a message if the current target is considered experimental.
unsigned ir_target_pointer_size(void)
Returns the size of a pointer in bytes for the target.
int ir_target_option(char const *option)
Configures the current target.
int ir_target_set(const char *target_triple)
Prepares code generation for the target specifiy by target_triple.
float_int_conversion_overflow_style_t ir_target_float_int_overflow_style(void)
Returns a.
unsigned ir_target_biggest_alignment(void)
Returns the biggest alignment required for any target data access.
int ir_target_supports_pic(void)
Returns 1 if target supports position independent code, 0 otherwise.
int ir_target_big_endian(void)
Returns 1 if target uses big endian byte order, 0 if little endian.
int ir_target_set_triple(ir_machine_triple_t const *machine)
Prepares code generation for the target specified by machine.
int ir_target_fast_unaligned_memaccess(void)
Returns 1 if unaligned memory accesses are (nearly) as fast as aligned ones, 0 otherwise.
void ir_target_init(void)
Initializes the code generation target.
unsigned ir_platform_type_size(ir_platform_type_t type)
Returns the size of the C type type in bytes.
ir_platform_type_t ir_platform_intptr_type(void)
Returns C type used for pointer sized integer like intptr_t or size_t.
char const * ir_platform_define_name(ir_platform_define_t const *define)
Returns the name of the preprocessor define define.
struct ir_platform_define_t ir_platform_define_t
Definition target.h:132
int ir_platform_supports_thread_local_storage(void)
Returns 1 if target and platform support thread local storage, 0 otherwise.
ir_mode * ir_platform_type_mode(ir_platform_type_t type, int is_signed)
Returns an ir_mode matching for the type type.
char ir_platform_user_label_prefix(void)
Returns the character "normal" linker identifiers are prefixed with.
int ir_platform_pic_is_default(void)
Returns 1 if target should compile position independent code by default.
ir_type * ir_platform_va_list_type(void)
Returns type used for va_list values.
ir_platform_define_t const * ir_platform_define_next(ir_platform_define_t const *define)
Returns the element following define in the list of target preprocessor defines or NULL if define is ...
ident * ir_platform_mangle_global(char const *name)
Returns name mangled for platform.
ir_platform_type_t ir_platform_wchar_type(void)
Returns the C type corresponding to wchar_t.
unsigned ir_platform_long_long_and_double_struct_align_override(void)
May return an override to long long and double alignment in structs.
ir_platform_type_t
Object types from the C programming language.
Definition target.h:120
unsigned ir_platform_type_align(ir_platform_type_t type)
Returns the alignment of the C type type in bytes.
char const * ir_platform_default_exe_name(void)
Returns the default executable name for the target (a.out or a.exe).
ir_platform_define_t const * ir_platform_define_first(void)
Returns the first element in the list of target preprocessor defines.
int ir_platform_wchar_is_signed(void)
Returns true if the wchar_t type is signed.
char const * ir_platform_define_value(ir_platform_define_t const *define)
Returns the value that the proprocessor define define should be defined to.
@ IR_TYPE_LONG
Definition target.h:125
@ IR_TYPE_DOUBLE
Definition target.h:128
@ IR_TYPE_CHAR
Definition target.h:122
@ IR_TYPE_FLOAT
Definition target.h:127
@ IR_TYPE_LONG_LONG
Definition target.h:126
@ IR_TYPE_SHORT
Definition target.h:123
@ IR_TYPE_INT
Definition target.h:124
@ IR_TYPE_LONG_DOUBLE
Definition target.h:129
@ IR_TYPE_BOOL
Definition target.h:121
const char * ir_triple_get_cpu_type(const ir_machine_triple_t *triple)
Returns the CPU type part of machine triple triple.
void ir_free_machine_triple(ir_machine_triple_t *triple)
Frees the machine triple structure triple.
const char * ir_triple_get_operating_system(const ir_machine_triple_t *triple)
Returns the operating system part of machine triple triple.
ir_machine_triple_t * ir_parse_machine_triple(const char *triple_string)
Parses machine triple string triple_string into a ir_machine_triple_t structure.
struct ir_machine_triple_t ir_machine_triple_t
Machine triple.
Definition firm_types.h:92
void ir_triple_set_cpu_type(ir_machine_triple_t *triple, const char *cpu_type)
Changes CPU type of triple to cpu_type.
const char * ir_triple_get_manufacturer(const ir_machine_triple_t *triple)
Returns the manufacturer part of machine triple triple.
ir_machine_triple_t * ir_get_host_machine_triple(void)
Creates a machine triple matching the host machine.
struct ir_type ir_type
Type.
Definition firm_types.h:71