From 4cdbd4062dfe9266a4d7facbad00ba691e194acd Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Wed, 9 Oct 2019 01:00:09 -0400 Subject: Add gen_argument to push args in the correct order --- gen_code.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gen_code.c b/gen_code.c index b89b622..c244dcb 100644 --- a/gen_code.c +++ b/gen_code.c @@ -135,6 +135,21 @@ ptree *t; } +void gen_arguments(t) +ptree *t; +{ + if (t->type != LIST){ + GEN_EXPR(t) + fprintf(stdout, "pushq\t%s", *reg_ptr); + + fprintf(stdout, "\n##ARGUMENT BOUNDARY\n"); + return; + } + + gen_arguments(t->r); + gen_arguments(t->l); +} + void gen_statement(t) ptree *t; { -- cgit v1.1