commit 734448b3325cec5c59a3ecc611a524a9719c4c75
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Apr 11 17:16:01 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Mon Apr 11 17:16:01 2016 +0200
[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)
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index b55a8bd..38e9390 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -144,6 +144,11 @@ data(Node *np)
void
writeout(void)
{
+ if (curfun->kind == GLOB)
+ fputs("export ", stdout);
+ printf("function $%s(", symname(curfun));
+ puts("){");
+ puts("}");
}
void