shithub: scc

Download patch

ref: 088f60d8c93ae098a85b5d2b25cfd9143d7789b2
parent: 56e56694ff267c2294b3ab20e9a60c05ed9cdf47
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Mar 13 17:05:02 EDT 2015

Organize functions in cc2.h using the origin files

This is a traitional way and is not bad.

--- a/cc2/cc2.h
+++ b/cc2/cc2.h
@@ -119,15 +119,22 @@
 extern Type Funct, l_int8,  l_int16,  l_int32,  l_int64,
                    l_uint8, l_uint16, l_uint32, l_uint64;
 
-/*TODO: separate functions for file */
+/* main.c */
 extern void error(unsigned nerror, ...);
+
+/* cgen.c */
 extern Node *genaddable(Node *np);
 extern void generate(Symbol *fun);
-extern void genstack(Symbol *fun);
 extern void apply(Node *list[], Node *(*fun)(Node *));
+
+/* parser.c */
 extern Symbol *parse(void);
+extern void prtree(Node *np);
+
+/* code.c */
 extern void code(uint8_t op, Node *to, Node *from);
+extern void writeout(void);
+
+/* optm.c */
 extern Node *optimize(Node *np);
-extern void prtree(Node *np);
 extern Node *imm(TINT i, Type *tp);
-extern void writeout(void);