Demo file choice
This commit is contained in:
@ -118,7 +118,7 @@ CGNode *findCG(TableNode *tn) {
|
|||||||
CGNode *addCG(TableNode *tn, int sp) {
|
CGNode *addCG(TableNode *tn, int sp) {
|
||||||
CGNode *cg = calloc(1, sizeof(CGNode));
|
CGNode *cg = calloc(1, sizeof(CGNode));
|
||||||
cg->tn = tn;
|
cg->tn = tn;
|
||||||
offset += 4; // <- quick fix getPrimSize(getTypeEntry(tn))
|
offset += getPrimSize(getTypeEntry(tn));
|
||||||
cg->address = offset;
|
cg->address = offset;
|
||||||
cg->next = cgList;
|
cg->next = cgList;
|
||||||
cgList = cg;
|
cgList = cg;
|
||||||
|
@ -129,6 +129,10 @@ TNodeOrConst * tn_or_const(Discriminant d, void * tnc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void emit_helper(void){
|
static void emit_helper(void){
|
||||||
|
if (!ir_flag) {
|
||||||
|
begin = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
Instruction * inst = calloc(1, sizeof(*inst));
|
Instruction * inst = calloc(1, sizeof(*inst));
|
||||||
if(begin == NULL){
|
if(begin == NULL){
|
||||||
begin = current = inst;
|
begin = current = inst;
|
||||||
|
@ -121,6 +121,7 @@ extern Instruction * begin;
|
|||||||
extern Instruction * current;
|
extern Instruction * current;
|
||||||
extern int label_count;
|
extern int label_count;
|
||||||
extern bool code_gen;
|
extern bool code_gen;
|
||||||
|
extern FILE * ir_flag;
|
||||||
|
|
||||||
|
|
||||||
TNodeOrConst * tn_or_const(Discriminant , void * );
|
TNodeOrConst * tn_or_const(Discriminant , void * );
|
||||||
|
Reference in New Issue
Block a user