71 bitfield->
size = size;
116 return &bitfield->
fields[i];
348 return &spec->
spec[i];
void dstring_init(dstring_t *string, unsigned int buffer_size)
Initializes a dynamic string (dstring).
void dstring_copy(dstring_t *string, const char *source)
Copies the content of source to the dstring.
void dstring_close(dstring_t *string)
Closes the dynamic string.
void hashtable_init(hashtable_t *hashtable, unsigned int size)
Initializes a hashtable.
error_code_t hashtable_get(hashtable_t *hashtable, const char *key, int64_t *value)
Get the value of the specified key inside the hashtable.
void hashtable_close(hashtable_t *hashtable)
Close the given hashtable.
void hashtable_set(hashtable_t *hashtable, const char *key, int64_t value)
Set the value of the specified key inside the hashtable.
mir_register_t * mir_add_register(mir_t *mir, const char *name, uint32_t size)
Add a new register declaration for the specified MIR.
void mir_bitfield_spec_close(mir_bitfield_spec_t *spec)
Closes the given bitfield spec.
mir_register_t * mir_get_register(mir_t *mir, const char *name)
Get a register declaration from the specified MIR.
void mir_instruction_close(mir_inst_t *inst)
Closes the given instruction.
void mir_bitfield_close(mir_bitfield_t *bitfield)
Closes the given bitfield.
mir_inst_t * mir_add_instruction(mir_t *mir, const char *name, uint32_t size)
Add a new instruction declaration to MIR.
void mir_close(mir_t *mir)
Closes the given MIR instruction.
mir_bitfield_t * mir_get_bitfield(mir_t *mir, const char *name)
Get the bitfield declaration with the given name.
mir_bitfield_spec_t * mir_bitfield_spec_get_field(mir_bitfield_spec_t *spec, const char *name)
Get a bitfield spec's field from the given bitfield spec.
mir_bitfield_spec_t * mir_bitfield_spec_set_spec(mir_bitfield_spec_t *spec, const char *name, mir_bitfield_spec_type_t type)
Set the bitfield spec's sub bitfield spec.
mir_bitfield_spec_t * mir_bitfield_spec_add_field(mir_bitfield_spec_t *spec, const char *name, mir_bitfield_spec_type_t type)
Add a new bitfield spec's field to the given bitfield spec.
void mir_register_close(mir_register_t *reg)
Closes the given register.
mir_inst_t * mir_get_instruction(mir_t *mir, const char *name)
Get an instruction declaration.
void mir_init(mir_t *mir)
Initializes a MIR struct.
mir_bitfield_field_t * mir_bitfield_add_field(mir_bitfield_t *bitfield, const char *name, uint32_t size)
Add a new field to a bitfield declaration.
mir_inst_param_t * mir_instruction_add_param(mir_inst_t *inst, const char *name, mir_type_t type, uint32_t size)
Add a new parameter specification to an instruction.
mir_bitfield_spec_t * mir_instruction_add_field(mir_inst_t *inst, const char *name, mir_bitfield_spec_type_t type)
Add a new body field to the given instruction.
mir_bitfield_t * mir_add_bitfield(mir_t *mir, const char *name, uint32_t size)
Add a new bitfield declaration.
mir_inst_param_t * mir_instruction_get_param(mir_inst_t *inst, const char *name)
Get a parameter from an instruction declaration.
mir_bitfield_spec_t * mir_instruction_get_field(mir_inst_t *inst, const char *name)
Get the body field from the instruction.
mir_bitfield_field_t * mir_bitfield_get_field(mir_bitfield_t *bitfield, const char *name)
Get the field with the given name from the bitfield declaration.
char * data
Pointer for the raw string content (a normal C string).
uint32_t size
Size in bits of the field.
dstring_t name
Name of the field.
mir_bitfield_spec_type_t type
Specify the type of this bitfield specification.
unsigned int _spec_size
Size of the allocated memory for spec array.
dstring_t identifier
Bitfield's value identifier.
struct mir_bitfield_spec * spec
Bitfield's list of field specifications.
unsigned int spec_length
Number of elements on the spec array.
dstring_t name
Name of the bitfield.
mir_bitfield_field_t * fields
Array of fields.
unsigned int fields_length
Number of elements on the fields array.
uint32_t size
Size in bits of the bitfield.
unsigned int _fields_size
Size of the allocated memory for fields array.
dstring_t name
Name of the bitfield.
mir_type_t type
Type of the parameter.
uint32_t size
Size in bits of the parameter.
dstring_t name
Name of the parameter.
dstring_t name
Instruction name.
unsigned int fields_length
Number of elements on the fields array.
unsigned int _fields_size
Size of the allocated memory for fields array.
unsigned int _parameters_size
Size of the allocated memory for parameters array.
mir_inst_param_t * parameters
List of instruction's parameters.
uint32_t size
Instruction size in bits.
mir_bitfield_spec_t * fields
Instruction field's specification list.
unsigned int parameters_length
Number of paramenters on the parameters array.
uint32_t size
Register size in bits.
mir_bitfield_spec_t spec
Register's bitfield specification.
dstring_t name
Register name.
Mya in-memory intermediate representation.
unsigned int _instructions_size
The size of the allocated memory for instructions list.
unsigned int registers_length
The number of declared registers.
hashtable_t variables
Hashtable of variables.
unsigned int instructions_length
The number of declared instructions.
mir_bitfield_t * bitfields
List of bitfields.
unsigned int bitfields_length
The number of declared bitfields.
hashtable_t _bitfields_index
Bitfields indexes.
hashtable_t _instructions_index
Instructions indexes.
mir_inst_t * instructions
List of instructions.
unsigned int _registers_size
The size of the allocated memory for registers list.
unsigned int _bitfields_size
The size of the allocated memory for bitfields list.
mir_register_t * registers
List of registers.
hashtable_t _registers_index
Registers indexes.
struct mir_register mir_register_t
Register declaration.
struct mir_bitfield_field mir_bitfield_field_t
A bitfield's field declaration.
#define MIR_LIST_INITIAL_SIZE
enum mir_bitfield_spec_type mir_bitfield_spec_type_t
A bitfield spec type.
#define MIR_REGISTER_HASHTABLE_SIZE
#define MIR_VARIABLE_HASHTABLE_SIZE
#define MIR_LIST_INCREMENT_SIZE
struct mir_inst_param mir_inst_param_t
An instruction's parameter.
struct mir_bitfield mir_bitfield_t
A bitfield declaration.
struct mir_bitfield_spec mir_bitfield_spec_t
A bitfield or bitfield's field declaration.
#define MIR_BITFIELD_HASHTABLE_SIZE
struct mir_inst mir_inst_t
Instruction declaration.
struct mir mir_t
Mya in-memory intermediate representation.
#define MIR_INSTRUCTION_HASHTABLE_SIZE