diff options
Diffstat (limited to 'includes/compiler/Switch.h')
-rw-r--r-- | includes/compiler/Switch.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/compiler/Switch.h b/includes/compiler/Switch.h new file mode 100644 index 0000000..4d2c2b3 --- /dev/null +++ b/includes/compiler/Switch.h @@ -0,0 +1,28 @@ +#ifndef COMPILER_SWITCH_H +#define COMPILER_SWITCH_H + +#include "compiler/common.h" + +typedef struct SwitchCase { + struct SwitchCase *next; + CLabel *label; + CInt64 min; + CInt64 max; +} SwitchCase; +typedef struct CaseRange { + CInt64 min; + CInt64 range; + PCodeLabel *label; +} CaseRange; + +typedef struct SwitchInfo { + SwitchCase *cases; + CLabel *defaultlabel; +} SwitchInfo; + +extern ObjectList *switchtables; + +extern void switchstatement(ENode *expr, SwitchInfo *info); +extern void dumpswitchtables(Object *funcobj); + +#endif |