2016-09-25 21:29:59 +00:00
|
|
|
#ifndef HOP_H
|
|
|
|
#define HOP_H
|
|
|
|
|
2016-09-27 21:38:47 +00:00
|
|
|
enum insel_type
|
|
|
|
{
|
|
|
|
INSEL_STRING,
|
2016-10-02 21:25:54 +00:00
|
|
|
INSEL_VREG,
|
2016-09-27 21:38:47 +00:00
|
|
|
INSEL_VALUE,
|
|
|
|
INSEL_EOI
|
|
|
|
};
|
|
|
|
|
|
|
|
struct insel
|
|
|
|
{
|
|
|
|
enum insel_type type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
const char* string;
|
2016-10-02 21:25:54 +00:00
|
|
|
struct vreg* vreg;
|
2016-09-27 21:38:47 +00:00
|
|
|
struct ir* value;
|
|
|
|
}
|
|
|
|
u;
|
|
|
|
};
|
|
|
|
|
2016-09-25 21:29:59 +00:00
|
|
|
struct hop
|
|
|
|
{
|
2016-09-27 21:38:47 +00:00
|
|
|
int id;
|
2016-09-25 21:29:59 +00:00
|
|
|
int insn_no;
|
|
|
|
struct ir* ir;
|
2016-09-27 21:38:47 +00:00
|
|
|
ARRAYOF(struct insel) insels;
|
2016-10-02 21:25:54 +00:00
|
|
|
struct vreg* output;
|
2016-09-25 21:29:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct hop* new_hop(int insn_no, struct ir* ir);
|
|
|
|
|
2016-09-27 21:38:47 +00:00
|
|
|
extern void hop_add_string_insel(struct hop* hop, const char* string);
|
2016-10-02 21:25:54 +00:00
|
|
|
extern void hop_add_vreg_insel(struct hop* hop, struct vreg* vreg);
|
2016-09-27 21:38:47 +00:00
|
|
|
extern void hop_add_value_insel(struct hop* hop, struct ir* ir);
|
|
|
|
extern void hop_add_eoi_insel(struct hop* hop);
|
|
|
|
|
2016-09-26 22:19:45 +00:00
|
|
|
extern void hop_print(char k, struct hop* hop);
|
2016-09-25 21:29:59 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|