automatically generate most getter/setter functions of firm nodes
[libfirm] / ir / ir / irdumptxt.c
index e37f6a0..6857397 100644 (file)
@@ -37,6 +37,7 @@
 #include "trouts.h"
 #include "irgwalk.h"
 #include "tv_t.h"
+#include "vrp.h"
 #include "irprintf.h"
 #include "error.h"
 
@@ -94,12 +95,23 @@ static FILE *text_open(const char *basename, const char * suffix1, const char *s
        return F;
 }
 
+static inline int is_ip_Filter(ir_node *n)
+{
+#ifdef INTERPROCEDURAL_VIEW
+       return is_Filter(n) && get_interprocedural_view();
+#else
+       (void) n;
+       return 0;
+#endif
+}
+
 /* Write the irnode and all its attributes to the file passed. */
 int dump_irnode_to_file(FILE *F, ir_node *n)
 {
-       int i, bad = 0;
-       char comma;
+       int      i, bad = 0;
+       char     comma;
        ir_graph *irg;
+       vrp_attr *vrp_info;
 
        dump_node_opcode(F, n);
        fprintf(F, " %ld\n", get_irn_node_nr(n));
@@ -175,7 +187,7 @@ int dump_irnode_to_file(FILE *F, ir_node *n)
        /* This is not nice, output it as a marker in the predecessor list. */
        if (is_Block(n)             ||
            get_irn_op(n) == op_Phi ||
-           (is_Filter(n) && get_interprocedural_view())) {
+           (is_ip_Filter(n))) {
                fprintf(F, "  backedges:");
                comma = ' ';
                for (i = 0; i < get_irn_arity(n); i++)
@@ -302,14 +314,18 @@ int dump_irnode_to_file(FILE *F, ir_node *n)
                ir_fprintf(F, "  cast to type: %+F\n", get_Cast_type(n));
        } break;
        case iro_Return: {
+#ifdef INTERPROCEDURAL_VIEW
                if (!get_interprocedural_view()) {
+#endif
                        ir_type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
                        ir_fprintf(F, "  return in method of type %+F\n", tp);
                        for (i = 0; i < get_method_n_ress(tp); ++i) {
                                ir_fprintf(F, "    result %d type: %+F\n", i,
                                           get_method_res_type(tp, i));
                        }
+#ifdef INTERPROCEDURAL_VIEW
                }
+#endif
        } break;
        case iro_Const: {
                assert(get_Const_type(n) != firm_none_type);
@@ -392,10 +408,12 @@ int dump_irnode_to_file(FILE *F, ir_node *n)
                        fprintf(F, "\n  volatile");
                fprintf(F, "\n");
        } break;
-       default: ;
+
+       default:
+               break;
        }
 
-       vrp_attr *vrp_info = vrp_get_info(n);
+       vrp_info = vrp_get_info(n);
        if (vrp_info) {
                dump_vrp_info(F, n);
        }
@@ -641,7 +659,8 @@ static void dump_entity_linkage(FILE *F, const ir_entity *entity)
                fprintf(F, " hidden_user");
 }
 
-void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned verbosity)
+static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix,
+                                       unsigned verbosity)
 {
        int i, j;
        ir_type *owner, *type;
@@ -937,7 +956,7 @@ void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned
        }
 }
 
-void    dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity)
+void dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity)
 {
        dump_entity_to_file_prefix (F, ent, "", verbosity);
        fprintf(F, "\n");