]> git.sur5r.net Git - cc65/blob - src/cc65/function.h
New optimization
[cc65] / src / cc65 / function.h
1 /*
2  * function.h
3  *
4  * Ullrich von Bassewitz, 07.06.1998
5  */
6
7
8
9 #ifndef FUNCTION_H
10 #define FUNCTION_H
11
12
13
14 /*****************************************************************************/
15 /*                                   data                                    */
16 /*****************************************************************************/
17
18
19
20 /* Structure that holds all data needed for function activation */
21 typedef struct Function Function;
22
23 /* Function activation data for current function (or NULL) */
24 extern Function* CurrentFunc;
25
26
27
28 /*****************************************************************************/
29 /*                                   Code                                    */
30 /*****************************************************************************/
31
32
33
34 const char* GetFuncName (const Function* F);
35 /* Return the name of the current function */
36
37 unsigned GetParamSize (const Function* F);
38 /* Return the parameter size for the current function */
39
40 type* GetReturnType (Function* F);
41 /* Get the return type for the function */
42
43 int HasVoidReturn (const Function* F);
44 /* Return true if the function does not have a return value */
45
46 void RememberEntry (Function* F);
47 /* Remember the current output position for local space creation later */
48
49 unsigned GetRetLab (const Function* F);
50 /* Return the return jump label */
51
52 int ReserveLocalSpace (Function* F, unsigned Size);
53 /* Reserve (but don't allocate) the given local space and return the stack
54  * offset.
55  */
56
57 void AllocLocalSpace (Function* F);
58 /* Allocate any local space previously reserved. The function will do
59  * nothing if there is no reserved local space.
60  */
61
62 void NewFunc (struct SymEntry* Func);
63 /* Parse argument declarations and function body. */
64
65
66
67 /* End of function.h */
68 #endif
69
70
71