NAME ^

compilers/imcc/instructions.c

DESCRIPTION ^

When generating the code, the instructions of the program are stored in an array.

After the register allocation is resolved, the instructions array is flushed.

These functions operate over this array and its contents.

Functions ^

Instruction *_mk_instruction

Creates a new instruction

void imcc_init_tables

RT#48260: Not yet documented!!!

int ins_reads2

Returns TRUE if instruction ins reads from a register of type t

int ins_writes2

Returns TRUE if instruction ins writes to a register of type t

int instruction_reads

next two functions are called very often, says gprof they should be fast

int instruction_writes

RT#48260: Not yet documented!!!

int get_branch_regno

Get the register number of an address which is a branch target

SymReg *get_branch_reg

Get the register corresponding to an address which is a branch target

Instruction *_delete_ins

Delete instruction ins. It's up to the caller to actually free the memory of ins, if appropriate.

The instruction following ins is returned.

Instruction *delete_ins

Delete instruction ins, and then free it.

The instruction following ins is returned.

void insert_ins

insert tmp after ins

void prepend_ins

insert tmp before ins

void subst_ins

Substitute tmp for ins. Free ins if needs_freeing is true.

Instruction *move_ins

Move instruction ins from its current position to the position following instruction to. Returns the instruction following the initial position of ins.

Instruction *emitb

Emit a single instruction into the current unit buffer.

void free_ins

Free the Instruction structure ins.

int ins_print

Print details of instruction ins in file fd.

static int e_file_open

RT#48260: Not yet documented!!!

static int e_file_close

RT#48260: Not yet documented!!!

static int e_file_emit

RT#48260: Not yet documented!!!

int emit_open

RT#48260: Not yet documented!!!

int emit_flush

RT#48260: Not yet documented!!!

int emit_close

RT#48260: Not yet documented!!!


parrot