ref: e130d49e620f3a806cd4f262f623bdfda985adf4
parent: cc767027f7fc598346f4ec9991f55085fd44230e
author: Roberto E. Vargas Caballero <[email protected]>
date: Mon Apr 11 13:16:01 EDT 2016
[cc2-qbe] Add skeleton for function code generation This is only a stub that prints the name of the function, although it still cannot print the type of the function because we do not have this information in our IR, although we can derive it from the code (from the return statements)
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -144,6 +144,11 @@
void
writeout(void)
{
+ if (curfun->kind == GLOB)
+ fputs("export ", stdout);
+ printf("function $%s(", symname(curfun));
+ puts("){");
+ puts("}");
}
void