summaryrefslogtreecommitdiff
path: root/includes/compiler/Switch.h
blob: 4d2c2b3f0efd3fe0de97f48f225605a073f0d73d (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
#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