2016-10-01 22:30:33 +00:00
|
|
|
#ifndef PROCEDURE_H
|
|
|
|
#define PROCEDURE_H
|
|
|
|
|
|
|
|
struct local
|
|
|
|
{
|
2016-10-02 14:08:46 +00:00
|
|
|
int size;
|
|
|
|
int offset;
|
2016-10-01 22:30:33 +00:00
|
|
|
bool is_register;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct procedure
|
|
|
|
{
|
|
|
|
const char* name;
|
2016-10-15 16:38:46 +00:00
|
|
|
struct basicblock* entry;
|
|
|
|
struct basicblock* exit;
|
2016-10-15 20:53:56 +00:00
|
|
|
int locals_size;
|
|
|
|
int spills_size;
|
|
|
|
int saved_size;
|
2016-11-11 20:17:45 +00:00
|
|
|
int fp_to_ab; /* argument base (indexes up) */
|
|
|
|
int fp_to_lb; /* locals base (indexes down) */
|
|
|
|
int fp_to_sb; /* spill base (indexes up) */
|
|
|
|
int fp_to_rb; /* saved registers base (indexes up) */
|
2016-10-01 22:30:33 +00:00
|
|
|
ARRAYOF(struct basicblock) blocks;
|
|
|
|
IMAPOF(struct local) locals;
|
2016-10-16 20:37:42 +00:00
|
|
|
ARRAYOF(struct hreg) usedregs;
|
2016-10-01 22:30:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern void procedure_compile(struct procedure* proc);
|
2016-10-02 14:08:46 +00:00
|
|
|
extern void procedure_update_bb_graph(struct procedure* proc);
|
2016-10-01 22:30:33 +00:00
|
|
|
|
2016-10-15 21:19:44 +00:00
|
|
|
extern struct procedure* current_proc;
|
|
|
|
|
2016-10-01 22:30:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim: set sw=4 ts=4 expandtab : */
|