emission for func dec
This commit is contained in:
@ -167,6 +167,7 @@ TNodeOrConst *tn_or_const(Discriminant d, void *tnc) {
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
static void emit_helper(void) {
|
||||
Instruction *inst = calloc(1, sizeof(*inst));
|
||||
if (begin == NULL) {
|
||||
@ -179,6 +180,11 @@ static void emit_helper(void) {
|
||||
current = inst;
|
||||
}
|
||||
}
|
||||
void emit_function_dec(TableNode * name){
|
||||
emit_helper();
|
||||
current->opcode = E_FUNC_DEC;
|
||||
current->result = name;
|
||||
}
|
||||
|
||||
void emit_binary_op(
|
||||
Op op,
|
||||
@ -405,6 +411,13 @@ void emit_as_file(FILE *out_file, Instruction *i) {
|
||||
return;
|
||||
}
|
||||
switch (i->opcode) {
|
||||
case E_FUNC_DEC:
|
||||
fprintf(out_file,
|
||||
"%4.d: func_dec : %s\n",
|
||||
i->index,
|
||||
getName(i->result));
|
||||
|
||||
break;
|
||||
case E_FUNC_START:
|
||||
fprintf(out_file,
|
||||
"%4.d: func : %s\n",
|
||||
|
Reference in New Issue
Block a user