2022-11-20 05:07:22 +00:00
|
|
|
#ifndef COMPILER_SWITCH_H
|
|
|
|
#define COMPILER_SWITCH_H
|
|
|
|
|
|
|
|
#include "compiler/common.h"
|
|
|
|
|
2022-12-29 12:32:55 +00:00
|
|
|
struct SwitchCase {
|
|
|
|
SwitchCase *next;
|
2022-11-20 05:07:22 +00:00
|
|
|
CLabel *label;
|
|
|
|
CInt64 min;
|
|
|
|
CInt64 max;
|
2022-12-29 12:32:55 +00:00
|
|
|
};
|
2022-11-20 05:07:22 +00:00
|
|
|
typedef struct CaseRange {
|
|
|
|
CInt64 min;
|
|
|
|
CInt64 range;
|
|
|
|
PCodeLabel *label;
|
|
|
|
} CaseRange;
|
|
|
|
|
2022-12-29 12:32:55 +00:00
|
|
|
struct SwitchInfo {
|
2022-11-20 05:07:22 +00:00
|
|
|
SwitchCase *cases;
|
|
|
|
CLabel *defaultlabel;
|
2022-12-29 12:32:55 +00:00
|
|
|
void *x8;
|
|
|
|
};
|
2022-11-20 05:07:22 +00:00
|
|
|
|
|
|
|
extern ObjectList *switchtables;
|
|
|
|
|
|
|
|
extern void switchstatement(ENode *expr, SwitchInfo *info);
|
|
|
|
extern void dumpswitchtables(Object *funcobj);
|
|
|
|
|
|
|
|
#endif
|