libFirm
Library Initialization

The functions in this section deal with initialization and deinitalization of the libFirm library. More...

Enumerations

enum  firm_kind {
  k_BAD = 0, k_entity, k_type, k_ir_graph,
  k_ir_node, k_ir_mode, k_tarval, k_ir_loop,
  k_ir_max
}
 A list of firm kinds. More...
 

Functions

void ir_init (void)
 Initializes the firm library and prepares code generation for the host. More...
 
void ir_init_library (void)
 Initializes the firm library but does not prepare for any code generation. More...
 
void ir_finish (void)
 Frees all memory occupied by the firm library. More...
 
unsigned ir_get_version_major (void)
 returns the libFirm major version number More...
 
unsigned ir_get_version_minor (void)
 returns libFirm minor version number More...
 
unsigned ir_get_version_micro (void)
 returns libFirm micro version number More...
 
const char * ir_get_version_revision (void)
 returns string describing libFirm revision More...
 
const char * ir_get_version_build (void)
 returns string describing libFirm build More...
 
firm_kind get_kind (const void *firm_thing)
 Returns the kind of a thing. More...
 

Detailed Description

The functions in this section deal with initialization and deinitalization of the libFirm library.

Enumeration Type Documentation

◆ firm_kind

enum firm_kind

A list of firm kinds.

Most important data structures in firm contain a firm_kind field at the beginning so given void* pointer you can usually still guess the kind of thing the pointer points to. This is used in debug helper functions and printers.

Enumerator
k_BAD 

An invalid firm node.

k_entity 

An entity.

k_type 

A type.

k_ir_graph 

An IR graph.

k_ir_node 

An IR node.

k_ir_mode 

An IR mode.

k_tarval 

A tarval.

k_ir_loop 

A loop.

k_ir_max 

maximum value – illegal for firm nodes.

Definition at line 68 of file firm_common.h.

Function Documentation

◆ get_kind()

firm_kind get_kind ( const void *  firm_thing)

Returns the kind of a thing.

Parameters
firm_thingpointer representing a firm object

◆ ir_finish()

void ir_finish ( void  )

Frees all memory occupied by the firm library.

◆ ir_get_version_build()

const char* ir_get_version_build ( void  )

returns string describing libFirm build

◆ ir_get_version_major()

unsigned ir_get_version_major ( void  )

returns the libFirm major version number

◆ ir_get_version_micro()

unsigned ir_get_version_micro ( void  )

returns libFirm micro version number

◆ ir_get_version_minor()

unsigned ir_get_version_minor ( void  )

returns libFirm minor version number

◆ ir_get_version_revision()

const char* ir_get_version_revision ( void  )

returns string describing libFirm revision

◆ ir_init()

void ir_init ( void  )

Initializes the firm library and prepares code generation for the host.

This is a convenince function that does:

ir_init_library();
ir_target_set_triple(ir_get_host_machine_triple());
ir_target_init();

◆ ir_init_library()

void ir_init_library ( void  )

Initializes the firm library but does not prepare for any code generation.

This is typically followed by target initialization (

See also
Target Setup and Information, ir_target_set(), ir_target_set_triple(), ir_target_init()) to get mode_P defined, a number of transformations also depend on Target Setup and Information information being available.