class bblock_t {
public:
- static void* operator new(size_t size, void *ctx)
- {
- void *node;
-
- node = rzalloc_size(ctx, size);
- assert(node != NULL);
-
- return node;
- }
+ DECLARE_RALLOC_CXX_OPERATORS(bblock_t)
bblock_link *make_list(void *mem_ctx);
bblock_t();
void add_successor(void *mem_ctx, bblock_t *successor);
+ void dump(backend_visitor *v);
backend_instruction *start;
backend_instruction *end;
exec_list parents;
exec_list children;
int block_num;
+
+ /* If the current basic block ends in an IF, ELSE, or ENDIF instruction,
+ * these pointers will hold the locations of the other associated control
+ * flow instructions.
+ *
+ * Otherwise they are NULL.
+ */
+ backend_instruction *if_inst;
+ backend_instruction *else_inst;
+ backend_instruction *endif_inst;
};
class cfg_t {
public:
- static void* operator new(size_t size, void *ctx)
- {
- void *node;
-
- node = rzalloc_size(ctx, size);
- assert(node != NULL);
-
- return node;
- }
+ DECLARE_RALLOC_CXX_OPERATORS(cfg_t)
cfg_t(backend_visitor *v);
+ cfg_t(void *mem_ctx, exec_list *instructions);
~cfg_t();
+
+ void create(void *mem_ctx, exec_list *instructions);
+
bblock_t *new_block();
void set_next_block(bblock_t *block);
void make_block_array();
+ void dump(backend_visitor *v);
+
/** @{
*
* Used while generating the block list.