* @{
*/
+/** Global variable holding the current ir graph.
+ *
+ * This global variable is used by the ir construction
+ * interface in ircons and by the optimizations.
+ * Further it is set by all walker functions.
+ */
+FIRM_API ir_graph *current_ir_graph;
+
+FIRM_API ir_graph *get_current_ir_graph(void);
+FIRM_API void set_current_ir_graph(ir_graph *graph);
+
/** Create an immature Block.
*
* An immature Block has an unknown number of predecessors. Predecessors
* @{
*/
-/** Global variable holding the current ir graph.
- *
- * This global variable is used by the ir construction
- * interface in ircons and by the optimizations.
- * Further it is set by all walker functions.
- */
-FIRM_API ir_graph *current_ir_graph;
-
-FIRM_API ir_graph *get_current_ir_graph(void);
-FIRM_API void set_current_ir_graph(ir_graph *graph);
-
/**
* Create a new ir graph to build ir for a procedure.
*
#include "irgwalk.h"
#include "irprog_t.h"
#include "irdump.h"
+#include "ircons_t.h"
#define NO_CFLOOPS_WITHOUT_HEAD 1
#include "irgraph_t.h"
#include "irextbb.h"
#include "irtools.h"
+#include "ircons.h"
/**
* An extended block.
#include "util.h"
#include "irprintf.h"
#include "error.h"
+#include "ircons.h"
/*--------------------------------------------------------------------*/
/** Accessing the out datastructures **/
#include "irdump.h"
#include "array.h"
#include "pmap.h"
+#include "ircons.h"
/* A variant of the loop tree that avoids loops without head.
This reduces the depth of the loop tree. */
void set_irn_typeinfo_type(ir_node *n, ir_type *tp)
{
- assert(get_irg_typeinfo_state(current_ir_graph) != ir_typeinfo_none);
+ assert(get_irg_typeinfo_state(get_irn_irg(n)) != ir_typeinfo_none);
pmap_insert(type_node_map, (void *)n, (void *)tp);
}
vrp_update_node(env->info, n);
- assure_irg_outs(get_current_ir_graph());
+ assure_irg_outs(get_irn_irg(n));
for (i = get_irn_n_outs(n) - 1; i >=0; --i) {
ir_node *succ = get_irn_out(n, i);
if (bitset_is_set(env->visited, get_irn_idx(succ))) {
(*emit)(irn);
} else {
panic("Error: No emit handler for node %+F (graph %+F)\n",
- irn, current_ir_graph);
+ irn, get_irn_irg(irn));
}
}
static copy_attr_func old_phi_copy_attr;
-void be_info_new_node(ir_node *node)
+void be_info_new_node(ir_graph *irg, ir_node *node)
{
struct obstack *obst;
backend_info_t *info;
if (is_Proj(node))
return;
- obst = be_get_be_obst(current_ir_graph);
+ obst = be_get_be_obst(irg);
info = OALLOCZ(obst, backend_info_t);
assert(node->backend_info == NULL);
static void init_walker(ir_node *node, void *data)
{
+ ir_graph *irg = get_irn_irg(node);
(void) data;
- be_info_new_node(node);
+ be_info_new_node(irg, node);
}
static bool initialized = false;
void be_info_init(void);
void be_info_free(void);
void be_info_init_irg(ir_graph *irg);
-void be_info_new_node(ir_node *node);
+void be_info_new_node(ir_graph *irg, ir_node *node);
void be_info_duplicate(const ir_node *old_node, ir_node *new_node);
int be_info_initialized(const ir_graph *irg);
#include "execfreq.h"
#include "irprofile.h"
#include "irpass_t.h"
+#include "ircons.h"
#include "bearch.h"
#include "be_t.h"
static void block_count_walker(ir_node *node, void *data)
{
unsigned long *cnt = (unsigned long*)data;
- if (node == get_irg_end_block(current_ir_graph))
+ if (node == get_irg_end_block(get_irn_irg(node)))
return;
(*cnt)++;
}
#ifdef DEBUG_libfirm
ir_fprintf(stderr,
"Optimisation warning tarval of %+F(%+F) is not a long.\n",
- node, current_ir_graph);
+ node, get_irn_irg(node));
#endif
return false;
}
#include "raw_bitset.h"
#include "dbginfo.h"
#include "lc_opts.h"
+#include "ircons.h"
#include "besched.h"
#include "benode.h"
(*func) (node);
} else {
panic("No emit handler for node %+F (graph %+F)\n", node,
- current_ir_graph);
+ get_irn_irg(node));
}
}
#include "irgopt.h"
#include "irgmod.h"
#include "irgwalk.h"
+#include "ircons.h"
#include "adt/pdeq.h"
#include "irgwalk.h"
#include "irhooks.h"
#include "entity_t.h"
+#include "ircons.h"
#include "error.h"
#include "pset_new.h"
#include "irhooks.h"
#include "array.h"
#include "hashptr.h"
+#include "ircons.h"
#define _get_walk_arity(env, node) \
((env)->follow_deps ? get_irn_ins_or_deps((node)) : get_irn_arity((node)))
hook_new_node(irg, res);
if (get_irg_phase_state(irg) == phase_backend) {
- be_info_new_node(res);
+ be_info_new_node(irg, res);
}
return res;
#include "irprog_t.h"
#include "irdump.h"
#include "irverify.h"
+#include "ircons.h"
#include "xmalloc.h"
typedef void (*void_pass_func_irg)(ir_graph *irg);
#include "obst.h"
#include "irop_t.h"
#include "irmemory.h"
+#include "ircons.h"
/** The initial name of the irp program. */
#define INITAL_PROG_NAME "no_name_set"
#include "irflag_t.h"
#include "irpass_t.h"
#include "irnodeset.h"
+#include "ircons.h"
/** if this flag is set, verify entity types in Load & Store nodes */
static int verify_entities = 0;
#include "irdump.h"
#include "dags.h"
#include "irtools.h"
+#include "ircons.h"
enum dag_counting_options_t {
FIRMSTAT_COPY_CONSTANTS = 0x00000001, /**< if set, constants will be treated as they are in
#include "xmalloc.h"
#include "irhooks.h"
#include "util.h"
+#include "ircons.h"
/*
* need this to be static:
#include "irgwalk.h"
#include "error.h"
#include "tv.h"
+#include "ircons.h"
#ifdef NDEBUG
/*
#include "irnode_t.h"
#include "irgwalk.h"
#include "error.h"
+#include "ircons.h"
/**
* The walker environment