#include "array.h"
#include "irbackedge_t.h"
#include "irdump.h"
+#include "irflag.h"
#ifdef DEBUG_libfirm
#include "irprog_t.h"
#define END_KEEPALIVE_OFFSET 0
/* Declarations for inlineing */
-INLINE ir_node ** get_irn_in (ir_node *node);
-INLINE ir_mode *get_irn_mode (ir_node *node);
-INLINE ir_op *get_irn_op (ir_node *node);
-INLINE opcode get_irn_opcode (ir_node *node);
-INLINE ident *get_irn_opident (ir_node *node);
+INLINE ir_node ** get_irn_in (const ir_node *node);
+INLINE ir_mode *get_irn_mode (const ir_node *node);
+INLINE ir_op *get_irn_op (const ir_node *node);
+INLINE opcode get_irn_opcode (const ir_node *node);
+INLINE ident *get_irn_opident (const ir_node *node);
INLINE type *get_SymConst_type (ir_node *node);
INLINE ir_node *skip_nop (ir_node *node);
-INLINE ir_node *skip_nop (ir_node *node);
-INLINE int is_Proj (ir_node *node);
+INLINE int is_Proj (const ir_node *node);
-static char *pnc_name_arr [] = {"False", "Eq", "Lt", "Le",
- "Gt", "Ge", "Lg", "Leg", "Uo",
- "Ue", "Ul", "Ule", "Ug", "Uge",
- "Ne", "True" };
+static const char *pnc_name_arr [] = {
+ "False", "Eq", "Lt", "Le",
+ "Gt", "Ge", "Lg", "Leg", "Uo",
+ "Ue", "Ul", "Ule", "Ug", "Uge",
+ "Ne", "True"
+};
-INLINE char *get_pnc_string(int pnc) {
+INLINE const char *get_pnc_string(int pnc) {
return pnc_name_arr[pnc];
}
return 99; /* to shut up gcc */
}
-static char *pns_name_arr [] = {"initial_exec", "global_store",
- "frame_base", "globals", "args"};
+static const char *pns_name_arr [] = {
+ "initial_exec", "global_store",
+ "frame_base", "globals", "args"
+};
-static char *symconst_name_arr [] = {"type_tag", "size", "linkage_ptr_info"};
+static const char *symconst_name_arr [] = {
+ "type_tag", "size", "linkage_ptr_info"
+};
void
init_irnode (void)
/* returns the number of predecessors without the block predecessor. */
INLINE int
-get_irn_arity (ir_node *node) {
+get_irn_arity (const ir_node *node) {
assert(node);
if (interprocedural_view) { /* handle Filter and Block specially */
if (get_irn_opcode(node) == iro_Filter) {
lists of operands as predecessors of Block or arguments of a Call are
consecutive. */
INLINE ir_node **
-get_irn_in (ir_node *node) {
+get_irn_in (const ir_node *node) {
assert(node);
if (interprocedural_view) { /* handle Filter and Block specially */
if (get_irn_opcode(node) == iro_Filter) {
}
INLINE ir_mode *
-get_irn_mode (ir_node *node)
+get_irn_mode (const ir_node *node)
{
assert (node);
return node->mode;
}
INLINE modecode
-get_irn_modecode (ir_node *node)
+get_irn_modecode (const ir_node *node)
{
assert (node);
return node->mode->code;
INLINE ident *
-get_irn_modeident (ir_node *node)
+get_irn_modeident (const ir_node *node)
{
assert(node);
- return node->mode->name;
+ return get_mode_ident(node->mode);
}
INLINE ir_op *
-get_irn_op (ir_node *node)
+get_irn_op (const ir_node *node)
{
assert (node);
return node->op;
}
INLINE opcode
-get_irn_opcode (ir_node *node)
+get_irn_opcode (const ir_node *node)
{
assert (node);
assert (k_ir_node == get_kind(node));
}
INLINE const char *
-get_irn_opname (ir_node *node)
+get_irn_opname (const ir_node *node)
{
assert(node);
return id_to_str(node->op->name);
}
INLINE ident *
-get_irn_opident (ir_node *node)
+get_irn_opident (const ir_node *node)
{
assert(node);
return node->op->name;
}
INLINE unsigned long
-get_irn_visited (ir_node *node)
+get_irn_visited (const ir_node *node)
{
assert (node);
return node->visited;
}
INLINE int
-irn_not_visited (ir_node *node) {
+irn_not_visited (const ir_node *node) {
assert (node);
return (node->visited < current_ir_graph->visited);
}
INLINE int
-irn_visited (ir_node *node) {
+irn_visited (const ir_node *node) {
assert (node);
return (node->visited >= current_ir_graph->visited);
}
}
INLINE void *
-get_irn_link (ir_node *node) {
+get_irn_link (const ir_node *node) {
assert (node);
return node->link;
}
/* Outputs a unique number for this node */
INLINE long
-get_irn_node_nr(ir_node *node) {
+get_irn_node_nr(const ir_node *node) {
assert(node);
#ifdef DEBUG_libfirm
return node->node_nr;
in array afterwards ... */
}
-ir_graph *get_EndReg_irg (ir_node *end) {
+ir_graph *get_EndReg_irg (const ir_node *end) {
assert (end->op == op_EndReg);
return end->attr.end.irg;
}
-ir_graph *get_EndExcept_irg (ir_node *end) {
+ir_graph *get_EndExcept_irg (const ir_node *end) {
assert (end->op == op_EndReg);
return end->attr.end.irg;
}
}
INLINE symconst_kind
-get_SymConst_kind (ir_node *node) {
+get_SymConst_kind (const ir_node *node) {
assert (node->op == op_SymConst);
return node->attr.i.num;
}
skip_Tuple (ir_node *node) {
ir_node *pred;
+ if (!get_opt_normalize()) return node;
+
node = skip_nop(node);
if (get_irn_op(node) == op_Proj) {
pred = skip_nop(get_Proj_pred(node));
skip_nop (ir_node *node) {
/* don't assert node !!! */
+ if (!get_opt_normalize()) return node;
+
/* Don't use get_Id_pred: We get into an endless loop for
self-referencing Ids. */
if (node && (node->op == op_Id) && (node != node->in[0+1])) {
}
INLINE int
-is_Proj (ir_node *node) {
+is_Proj (const ir_node *node) {
assert(node);
return node->op == op_Proj
|| (!interprocedural_view && node->op == op_Filter);