From 9d2728a5605f651934fe67a6fe6986b3e4a2c011 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sun, 20 Nov 2022 00:07:22 -0500 Subject: add a bunch of code and a ton of stub files for later --- includes/compiler/Switch.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 includes/compiler/Switch.h (limited to 'includes/compiler/Switch.h') 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 -- cgit v1.2.3