libFirm

Functions to work with machine triples. More...

Typedefs

typedef struct ir_machine_triple_t ir_machine_triple_t
 Machine triple. More...
 

Functions

ir_machine_triple_tir_parse_machine_triple (const char *triple_string)
 Parses machine triple string triple_string into a ir_machine_triple_t structure. More...
 
ir_machine_triple_tir_get_host_machine_triple (void)
 Creates a machine triple matching the host machine. More...
 
const char * ir_triple_get_cpu_type (const ir_machine_triple_t *triple)
 Returns the CPU type part of machine triple triple. More...
 
const char * ir_triple_get_manufacturer (const ir_machine_triple_t *triple)
 Returns the manufacturer part of machine triple triple. More...
 
const char * ir_triple_get_operating_system (const ir_machine_triple_t *triple)
 Returns the operating system part of machine triple triple. More...
 
void ir_triple_set_cpu_type (ir_machine_triple_t *triple, const char *cpu_type)
 Changes CPU type of triple to cpu_type. More...
 
void ir_free_machine_triple (ir_machine_triple_t *triple)
 Frees the machine triple structure triple. More...
 

Detailed Description

Functions to work with machine triples.

A machine triple describes a combination of CPU type, manufacturer and operating system. A machine triple is specified as a single string of the form 'cpu-manufacturer-system' where 'system' may be the name of the operating system or just the name of the kernel. This is the same concept as the target triplet in autoconfs config.guess/config.sub. Or LLVMs triple.

The manufacturer and system part may be left out, "none" or "unknown". There is some built-in disambiguation logic that recognizes linux-gnu as the operating system even when the manufacturer was left out.

"unknown" and "elf" may be used for the operating system resulting in ELF objects being produced without assumptions about the operating system.

Examples:

Triple CPU Manufacturer Operating System
i686-linux-gnu i686 unknown linux-gnu
i686-unknown-linux-gnu i686 unknown linux-gnu
x86_64-pc-mingw32 x86_64 pc mingw32
i686-apple-darwin x86_64 apple darwin
x86_64-apple-darwin16.4 x86_64 apple darwin16.4
sparc-leon-elf sparc leon elf
arm-eabi arm unknown eabi
arm-none-eabi arm unknown eabi
mips– mips unknown unknown
mips- mips unknown unknown
mips mips unknown unknown

Contrary to most functions, the triple manipulation functions may be used safely before ir_init() is called.

Typedef Documentation

◆ ir_machine_triple_t

Machine triple.

Definition at line 92 of file firm_types.h.

Function Documentation

◆ ir_free_machine_triple()

void ir_free_machine_triple ( ir_machine_triple_t triple)

Frees the machine triple structure triple.

◆ ir_get_host_machine_triple()

ir_machine_triple_t* ir_get_host_machine_triple ( void  )

Creates a machine triple matching the host machine.

Always succeeds or calls panic().

◆ ir_parse_machine_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.

◆ ir_triple_get_cpu_type()

const char* ir_triple_get_cpu_type ( const ir_machine_triple_t triple)

Returns the CPU type part of machine triple triple.

◆ ir_triple_get_manufacturer()

const char* ir_triple_get_manufacturer ( const ir_machine_triple_t triple)

Returns the manufacturer part of machine triple triple.

◆ ir_triple_get_operating_system()

const char* ir_triple_get_operating_system ( const ir_machine_triple_t triple)

Returns the operating system part of machine triple triple.

◆ ir_triple_set_cpu_type()

void ir_triple_set_cpu_type ( ir_machine_triple_t triple,
const char *  cpu_type 
)

Changes CPU type of triple to cpu_type.