]> git.sur5r.net Git - cc65/blobdiff - src/cc65/function.h
Add checks for risky goto statements.
[cc65] / src / cc65 / function.h
index 627457277e0040183a00ea2466115627aaca3a2d..1b04009d66c0ab783272a5f10c246e6d7e1f4a8d 100644 (file)
 #ifndef FUNCTION_H
 #define FUNCTION_H
 
-
+#include "coll.h"
 
 /*****************************************************************************/
-/*                                   data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
+/* Enumeration for function flags */
+typedef enum {
+    FF_NONE             = 0x0000,
+    FF_HAS_RETURN       = 0x0001,       /* Function has a return statement */
+    FF_IS_MAIN          = 0x0002,       /* This is the main function */
+    FF_VOID_RETURN      = 0x0004,       /* Function returning void */
+} funcflags_t;
+
+/* Structure that holds all data needed for function activation */
+struct Function {
+    struct SymEntry*    FuncEntry;        /* Symbol table entry */
+    Type*               ReturnType;       /* Function return type */
+    FuncDesc*           Desc;             /* Function descriptor */
+    int                 Reserved;         /* Reserved local space */
+    unsigned            RetLab;           /* Return code label */
+    int                 TopLevelSP;       /* SP at function top level */
+    unsigned            RegOffs;          /* Register variable space offset */
+    funcflags_t         Flags;            /* Function flags */
+    long                LocalsBlockCount; /* Number of blocks with local vars */
+    Collection          LocalsBlockStack; /* Stack of blocks with local vars */
+};
+
+
 
 /* Structure that holds all data needed for function activation */
 typedef struct Function Function;