libFirm
Target platform information

The functions in this API return information about the operating system or runtime system. More...

Typedefs

typedef struct ir_platform_define_t ir_platform_define_t
 

Enumerations

enum  ir_platform_type_t {
  IR_TYPE_BOOL, IR_TYPE_CHAR, IR_TYPE_SHORT, IR_TYPE_INT,
  IR_TYPE_LONG, IR_TYPE_LONG_LONG, IR_TYPE_FLOAT, IR_TYPE_DOUBLE,
  IR_TYPE_LONG_DOUBLE
}
 Object types from the C programming language. More...
 

Functions

unsigned ir_platform_long_long_and_double_struct_align_override (void)
 May return an override to long long and double alignment in structs. More...
 
int ir_platform_pic_is_default (void)
 Returns 1 if target should compile position independent code by default. More...
 
int ir_platform_supports_thread_local_storage (void)
 Returns 1 if target and platform support thread local storage, 0 otherwise. More...
 
char const * ir_platform_define_value (ir_platform_define_t const *define)
 Returns the value that the proprocessor define define should be defined to. More...
 
ir_platform_type_t ir_platform_wchar_type (void)
 Returns the C type corresponding to wchar_t. More...
 
int ir_platform_wchar_is_signed (void)
 Returns true if the wchar_t type is signed. More...
 
ir_platform_type_t ir_platform_intptr_type (void)
 Returns C type used for pointer sized integer like intptr_t or size_t. More...
 
unsigned ir_platform_type_size (ir_platform_type_t type)
 Returns the size of the C type type in bytes. More...
 
unsigned ir_platform_type_align (ir_platform_type_t type)
 Returns the alignment of the C type type in bytes. More...
 
ir_modeir_platform_type_mode (ir_platform_type_t type, int is_signed)
 Returns an ir_mode matching for the type type. More...
 
ir_typeir_platform_va_list_type (void)
 Returns type used for va_list values. More...
 
char ir_platform_user_label_prefix (void)
 Returns the character "normal" linker identifiers are prefixed with. More...
 
char const * ir_platform_default_exe_name (void)
 Returns the default executable name for the target (a.out or a.exe). More...
 
identir_platform_mangle_global (char const *name)
 Returns name mangled for platform. More...
 
ir_platform_define_t const * ir_platform_define_first (void)
 Returns the first element in the list of target preprocessor defines. More...
 
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 the last element. More...
 
char const * ir_platform_define_name (ir_platform_define_t const *define)
 Returns the name of the preprocessor define define. More...
 

Detailed Description

The functions in this API return information about the operating system or runtime system.

This contains information about the platform ABI such as the size and alignment of C types, the name mangling of global symbols and a list of platform and target specific C preprocessor definitions.

Typedef Documentation

◆ ir_platform_define_t

Definition at line 132 of file target.h.

Enumeration Type Documentation

◆ ir_platform_type_t

Object types from the C programming language.

This is a simplified list that does not differentiate between signed and unsigned types.

Enumerator
IR_TYPE_BOOL 
IR_TYPE_CHAR 
IR_TYPE_SHORT 
IR_TYPE_INT 
IR_TYPE_LONG 
IR_TYPE_LONG_LONG 
IR_TYPE_FLOAT 
IR_TYPE_DOUBLE 
IR_TYPE_LONG_DOUBLE 

Definition at line 120 of file target.h.

Function Documentation

◆ ir_platform_default_exe_name()

char const* ir_platform_default_exe_name ( void  )

Returns the default executable name for the target (a.out or a.exe).

◆ ir_platform_define_first()

ir_platform_define_t const* ir_platform_define_first ( void  )

Returns the first element in the list of target preprocessor defines.

◆ ir_platform_define_name()

char const* ir_platform_define_name ( ir_platform_define_t const *  define)

Returns the name of the preprocessor define define.

◆ ir_platform_define_next()

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 the last element.

◆ ir_platform_define_value()

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_platform_intptr_type()

ir_platform_type_t ir_platform_intptr_type ( void  )

Returns C type used for pointer sized integer like intptr_t or size_t.

◆ ir_platform_long_long_and_double_struct_align_override()

unsigned ir_platform_long_long_and_double_struct_align_override ( void  )

May return an override to long long and double alignment in structs.

This is a special case: Old C compilers had a bug where long long and double where aligned differently inside structs. Some ABIs explicitely stay compatible to this.

◆ ir_platform_mangle_global()

ident* ir_platform_mangle_global ( char const *  name)

Returns name mangled for platform.

This usually adds the user_label_prefix ('_' on win32, macOS, "" on ELF based systems) in front of the identifier.

◆ ir_platform_pic_is_default()

int ir_platform_pic_is_default ( void  )

Returns 1 if target should compile position independent code by default.

◆ ir_platform_supports_thread_local_storage()

int ir_platform_supports_thread_local_storage ( void  )

Returns 1 if target and platform support thread local storage, 0 otherwise.

◆ ir_platform_type_align()

unsigned ir_platform_type_align ( ir_platform_type_t  type)

Returns the alignment of the C type type in bytes.

◆ ir_platform_type_mode()

ir_mode* ir_platform_type_mode ( ir_platform_type_t  type,
int  is_signed 
)

Returns an ir_mode matching for the type type.

◆ ir_platform_type_size()

unsigned ir_platform_type_size ( ir_platform_type_t  type)

Returns the size of the C type type in bytes.

◆ ir_platform_user_label_prefix()

char ir_platform_user_label_prefix ( void  )

Returns the character "normal" linker identifiers are prefixed with.

◆ ir_platform_va_list_type()

ir_type* ir_platform_va_list_type ( void  )

Returns type used for va_list values.

May be a pointer type, a struct type or NULL if the backend does not support variadic functions.

◆ ir_platform_wchar_is_signed()

int ir_platform_wchar_is_signed ( void  )

Returns true if the wchar_t type is signed.

◆ ir_platform_wchar_type()

ir_platform_type_t ir_platform_wchar_type ( void  )

Returns the C type corresponding to wchar_t.

Note that technically in C++ wchar_t is an own type; this function will return a type with the same characteristics anyway.