int fieldtype;
/* and the output type of a function */
int outtype;
+ /* 'const' vs 'var' qualifier */
+ int cvq;
struct ir_instr_s **reads;
struct ir_instr_s **writes;
/* constantvalues */
- bool isconst;
+ bool hasvalue;
union {
float vfloat;
int vint;
/* For the temp-allocation */
size_t eid;
+ /* For IFs */
+ bool likely;
+
struct ir_block_s *owner;
} ir_instr;
/* locally defined variables */
ir_value **locals;
- /* how many of the locals are parameters */
- size_t max_parameters;
-
size_t allocated_locals;
ir_block* first;
bool ir_function_set_name(ir_function*, const char *name);
-ir_value* ir_function_get_local(ir_function *self, const char *name);
ir_value* ir_function_create_local(ir_function *self, const char *name, int vtype, bool param);
bool GMQCC_WARN ir_function_finalize(ir_function*);
bool ir_function_calculate_liferanges(ir_function*);
*/
-ir_block* ir_function_create_block(ir_function*, const char *label);
+ir_block* ir_function_create_block(lex_ctx ctx, ir_function*, const char *label);
void ir_function_dump(ir_function*, char *ind, int (*oprintf)(const char*,...));
/* builder */
+#define IR_HT_SIZE 1024
typedef struct ir_builder_s
{
char *name;
ir_value **globals;
ir_value **fields;
+ ht htfunctions;
+ ht htglobals;
+ ht htfields;
+
ir_value **extparams;
const char **filenames;