summaryrefslogtreecommitdiff
path: root/includes/compiler/Switch.h
blob: aeac03ee1f0bf8b408097303c1fc0726929fa5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef COMPILER_SWITCH_H
#define COMPILER_SWITCH_H

#include "compiler/common.h"

struct SwitchCase {
    SwitchCase *next;
    CLabel *label;
    CInt64 min;
    CInt64 max;
};
typedef struct CaseRange {
    CInt64 min;
    CInt64 range;
    PCodeLabel *label;
} CaseRange;

struct SwitchInfo {
    SwitchCase *cases;
    CLabel *defaultlabel;
    Type *x8;
};

extern ObjectList *switchtables;

extern void switchstatement(ENode *expr, SwitchInfo *info);
extern void dumpswitchtables(Object *funcobj);

#endif