summaryrefslogtreecommitdiff
path: root/includes/compiler/Switch.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
committerAsh Wolf <ninji@wuffs.org>2022-11-20 00:07:22 -0500
commit9d2728a5605f651934fe67a6fe6986b3e4a2c011 (patch)
treee81e0a3588a0c8d1855bf28316efe27d86b04d66 /includes/compiler/Switch.h
parent9a46dd0e2e80790d9848c0bbd718932a27c23269 (diff)
downloadMWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.tar.gz
MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.zip
add a bunch of code and a ton of stub files for later
Diffstat (limited to '')
-rw-r--r--includes/compiler/Switch.h28
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