Cthulhu  0.2.10
Cthulhu compiler collection
SSA form IR

SSA form IR. More...

Collaboration diagram for SSA form IR:

Data Structures

struct  ssa_storage_t
 ssa underlying storage type More...
 
struct  ssa_param_t
 
struct  ssa_local_t
 
struct  ssa_const_t
 
struct  ssa_field_t
 
struct  ssa_type_digit_t
 
struct  ssa_case_t
 
struct  ssa_type_enum_t
 
struct  ssa_type_closure_t
 
struct  ssa_type_pointer_t
 
struct  ssa_type_record_t
 
struct  ssa_type_t
 
union  ssa_literal_value_t
 
union  ssa_relative_value_t
 
struct  ssa_value_t
 
struct  ssa_operand_t
 
struct  ssa_store_t
 
struct  ssa_load_t
 
struct  ssa_addr_t
 
struct  ssa_unary_t
 
struct  ssa_binary_t
 
struct  ssa_compare_t
 
struct  ssa_cast_t
 
struct  ssa_call_t
 
struct  ssa_offset_t
 
struct  ssa_member_t
 
struct  ssa_return_t
 
struct  ssa_branch_t
 
struct  ssa_jump_t
 
struct  ssa_sizeof_t
 
struct  ssa_alignof_t
 
struct  ssa_offsetof_t
 
struct  ssa_step_t
 
struct  ssa_block_t
 
struct  ssa_symbol_t
 
struct  ssa_module_t
 
struct  ssa_result_t
 

Typedefs

typedef typedefCT_BEGIN_API struct tree_t tree_t
 

Enumerations

enum  ssa_kind_t { eTypeCount }
 
enum  ssa_opkind_t { eOperandCount }
 
enum  ssa_opcode_t { eOpCount }
 
enum  ssa_value_state_t { eValueCount }
 

Functions

CT_SSA_API ssa_result_t ssa_compile (vector_t *mods, arena_t *arena)
 compile a set of trees into their ssa form More...
 
CT_SSA_API void ssa_opt (logger_t *reports, ssa_result_t mod, arena_t *arena)
 Optimize a given module. More...
 
CT_SSA_API ssa_type_tssa_type_bool (const char *name, tree_quals_t quals)
 
CT_SSA_API ssa_type_tssa_type_digit (const char *name, tree_quals_t quals, sign_t sign, digit_t digit)
 
CT_SSA_API ssa_type_tssa_type_pointer (const char *name, tree_quals_t quals, ssa_type_t *pointer, size_t length)
 
CT_SSA_API ssa_literal_value_t ssa_value_get_literal (const ssa_value_t *value)
 
CT_SSA_API bool ssa_value_get_bool (const ssa_value_t *value)
 
CT_SSA_API void ssa_value_get_digit (const ssa_value_t *value, OUT_NOTNULL mpz_t result)
 
CT_CONSTFN CT_NODISCARD CT_SSA_API const char * ssa_type_name (STA_IN_RANGE(0, eTypeCount - 1) ssa_kind_t kind)
 
CT_CONSTFN CT_NODISCARD CT_SSA_API const char * ssa_opkind_name (STA_IN_RANGE(0, eOperandCount - 1) ssa_opkind_t kind)
 
CT_CONSTFN CT_NODISCARD CT_SSA_API const char * ssa_opcode_name (STA_IN_RANGE(0, eOpCount - 1) ssa_opcode_t opcode)
 
CT_CONSTFN CT_NODISCARD CT_SSA_API const char * ssa_value_name (STA_IN_RANGE(0, eValueCount - 1) ssa_value_state_t value)
 

Detailed Description

SSA form IR.

Typedef Documentation

◆ tree_t

typedef struct tree_t tree_t

Definition at line 14 of file attrib.h.

Enumeration Type Documentation

◆ ssa_kind_t

enum ssa_kind_t
Enumerator
eTypeCount 

Definition at line 40 of file ssa.h.

◆ ssa_opcode_t

Enumerator
eOpCount 

Definition at line 54 of file ssa.h.

◆ ssa_opkind_t

Enumerator
eOperandCount 

Definition at line 47 of file ssa.h.

◆ ssa_value_state_t

Enumerator
eValueCount 

Definition at line 61 of file ssa.h.

Function Documentation

◆ ssa_compile()

CT_SSA_API ssa_result_t ssa_compile ( vector_t mods,
arena_t arena 
)

compile a set of trees into their ssa form

Parameters
modsthe modules to compile
arenathe arena to allocate in
Returns
the compiled modules

Definition at line 911 of file ssa.c.

◆ ssa_opcode_name()

CT_CONSTFN CT_NODISCARD CT_SSA_API const char* ssa_opcode_name ( STA_IN_RANGE(0, eOpCount - 1) ssa_opcode_t  opcode)

◆ ssa_opkind_name()

CT_CONSTFN CT_NODISCARD CT_SSA_API const char* ssa_opkind_name ( STA_IN_RANGE(0, eOperandCount - 1) ssa_opkind_t  kind)

◆ ssa_opt()

CT_SSA_API void ssa_opt ( logger_t reports,
ssa_result_t  mod,
arena_t arena 
)

Optimize a given module.

optimization api

Parameters
reportsreport sink
modmodule to optimize
arenaarena to allocate in

Definition at line 359 of file opt.c.

◆ ssa_type_bool()

CT_SSA_API ssa_type_t* ssa_type_bool ( const char *  name,
tree_quals_t  quals 
)

rewriting

Definition at line 37 of file type.c.

◆ ssa_type_digit()

CT_SSA_API ssa_type_t* ssa_type_digit ( const char *  name,
tree_quals_t  quals,
sign_t  sign,
digit_t  digit 
)

Definition at line 42 of file type.c.

◆ ssa_type_name()

CT_CONSTFN CT_NODISCARD CT_SSA_API const char* ssa_type_name ( STA_IN_RANGE(0, eTypeCount - 1) ssa_kind_t  kind)

names

◆ ssa_type_pointer()

CT_SSA_API ssa_type_t* ssa_type_pointer ( const char *  name,
tree_quals_t  quals,
ssa_type_t pointer,
size_t  length 
)

Definition at line 63 of file type.c.

◆ ssa_value_get_bool()

CT_SSA_API bool ssa_value_get_bool ( const ssa_value_t value)

Definition at line 136 of file value.c.

◆ ssa_value_get_digit()

CT_SSA_API void ssa_value_get_digit ( const ssa_value_t value,
OUT_NOTNULL mpz_t  result 
)

◆ ssa_value_get_literal()

CT_SSA_API ssa_literal_value_t ssa_value_get_literal ( const ssa_value_t value)

query

Definition at line 128 of file value.c.

◆ ssa_value_name()

CT_CONSTFN CT_NODISCARD CT_SSA_API const char* ssa_value_name ( STA_IN_RANGE(0, eValueCount - 1) ssa_value_state_t  value)