changeset 27:77626fc37af2

Added support for removing stack from in epilog
author lost@l-w.ca
date Thu, 27 Jan 2011 20:46:44 -0700
parents 26aa76da75ad
children 9ac1c97d01db
files lwbasic/compiler.c lwbasic/emit.c lwbasic/lwbasic.h
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lwbasic/compiler.c	Thu Jan 27 20:44:57 2011 -0700
+++ b/lwbasic/compiler.c	Thu Jan 27 20:46:44 2011 -0700
@@ -169,7 +169,7 @@
 		}
 	}
 	/* output function/sub epilog */
-	emit_epilog(state);
+	emit_epilog(state, 0);
 	
 	lw_free(state -> currentsub);
 	state -> currentsub = NULL;
--- a/lwbasic/emit.c	Thu Jan 27 20:44:57 2011 -0700
+++ b/lwbasic/emit.c	Thu Jan 27 20:46:44 2011 -0700
@@ -41,7 +41,11 @@
 	}
 }
 
-void emit_epilog(cstate *state)
+void emit_epilog(cstate *state, int framesize)
 {
+	if (framesize > 0)
+	{
+		printf("\tleas %d,s\n", framesize);
+	}
 	printf("\trts\n");
 }
--- a/lwbasic/lwbasic.h	Thu Jan 27 20:44:57 2011 -0700
+++ b/lwbasic/lwbasic.h	Thu Jan 27 20:46:44 2011 -0700
@@ -101,7 +101,7 @@
 
 #ifndef __emit_c_seen__
 extern void emit_prolog(cstate *state, int vis, int framesize);
-extern void emit_epilog(cstate *state);
+extern void emit_epilog(cstate *state, int framesize);
 #endif