don't rely on obstack hacks
[libfirm] / ir / ir / irdumptxt.c
index 83b80e0..e7e5ceb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
 #include <stdarg.h>
 
 #include "irdump_t.h"
+#include "irgraph_t.h"
 
 #include "firm_common_t.h"
 
-#include "irgraph_t.h"
 #include "irprog_t.h"
 #include "entity_t.h"
 #include "trouts.h"
 #include "irgwalk.h"
 #include "tv_t.h"
+#include "irprintf.h"
 
 #include "irdom.h"
 #include "field_temperature.h"
@@ -200,6 +201,7 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
        /* Source types */
        switch (get_irn_opcode(n)) {
        case iro_Block: {
+               ir_fprintf(F, "  macro Block: %+F\n", get_Block_MacroBlock(n));
                fprintf(F, "  block visited: %ld\n", get_Block_block_visited(n));
                if (get_irg_dom_state(get_irn_irg(n)) != dom_none) {
                        fprintf(F, "  dom depth %d\n", get_Block_dom_depth(n));
@@ -207,12 +209,12 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
                        fprintf(F, "  max subtree pre num %d\n", get_Block_dom_max_subtree_pre_num(n));
                }
 
-               fprintf(F, "  Execution freqency statistics:\n");
+               fprintf(F, "  Execution frequency statistics:\n");
                if (get_irg_exec_freq_state(get_irn_irg(n)) != exec_freq_none)
                        fprintf(F, "    procedure local evaluation:   %8.2lf\n", get_irn_exec_freq(n));
 #ifdef INTERPROCEDURAL_VIEW
                if (get_irp_loop_nesting_depth_state() != loop_nesting_depth_none)
-                       fprintf(F, "    call freqency of procedure:   %8.2lf\n",
+                       fprintf(F, "    call frequency of procedure:   %8.2lf\n",
                        get_irg_method_execution_frequency(get_irn_irg(n)));
                if (get_irp_callgraph_state() == irp_callgraph_and_calltree_consistent)
                        fprintf(F, "    recursion depth of procedure: %8.2lf\n", (double)get_irn_recursion_depth(n));
@@ -528,9 +530,9 @@ static void dump_node_list(FILE *F, firm_kind *k, char *prefix,
  *  "prefix"    node16, node17\n
  */
 static void dump_type_list(FILE *F, ir_type *tp, char *prefix,
-                           int (*get_n_types)(ir_type *tp),
-                           ir_type *(*get_type)(ir_type *tp, int pos),
-                           char *name) {
+                           int (*get_n_types)(const ir_type *tp),
+                           ir_type *(*get_type)(const ir_type *tp, int pos),
+                           const char *name) {
        int i, n_nodes = get_n_types(tp);
        char *comma = "";
 
@@ -632,6 +634,9 @@ void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned
                        fprintf(F, "\n%s  calling convention: ", prefix);
                        if (cc & cc_reg_param) fprintf(F, "regparam, ");
                        if (cc & cc_this_call) fprintf(F, "thiscall, ");
+                       if (cc & cc_compound_ret) fprintf(F, "compound_ret, ");
+                       if (cc & cc_frame_on_caller_stk) fprintf(F, "frame on caller's stack, ");
+                       cc &= ~(cc_compound_ret|cc_frame_on_caller_stk);
                        if (IS_CDECL(cc))
                                fprintf(F, "cdecl");
                        else if (IS_STDCALL(cc))
@@ -668,9 +673,9 @@ void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned
                                for (i = 0; i < get_compound_ent_n_values(ent); ++i) {
                                        compound_graph_path *path = get_compound_ent_value_path(ent, i);
                                        ir_entity *ent0 = get_compound_graph_path_node(path, 0);
-                                       fprintf(F, "\n%s    %3d:%d ", prefix, get_entity_offset(ent0), get_entity_offset_bits_remainder(ent0));
+                                       fprintf(F, "\n%s    %3d:%u ", prefix, get_entity_offset(ent0), get_entity_offset_bits_remainder(ent0));
                                        if (get_type_state(type) == layout_fixed)
-                                               fprintf(F, "(%3d:%d) ",   get_compound_ent_value_offset_bytes(ent, i), get_compound_ent_value_offset_bit_remainder(ent, i));
+                                               fprintf(F, "(%3u:%u) ",   get_compound_ent_value_offset_bytes(ent, i), get_compound_ent_value_offset_bit_remainder(ent, i));
                                        fprintf(F, "%s", get_entity_name(ent));
                                        for (j = 0; j < get_compound_graph_path_length(path); ++j) {
                                                ir_entity *node = get_compound_graph_path_node(path, j);
@@ -1217,8 +1222,8 @@ void dump_type_to_file(FILE *F, ir_type *tp, dump_verbosity verbosity) {
 
        fprintf(F, "  visibility: %s,\n", get_visibility_name(get_type_visibility(tp)));
        fprintf(F, "  state:      %s,\n", get_type_state_name(get_type_state(tp)));
-       fprintf(F, "  size:       %2d Bits,\n",  get_type_size_bits(tp));
-       fprintf(F, "  alignment:  %2d Bits,\n",  get_type_alignment_bits(tp));
+       fprintf(F, "  size:       %2u Bytes,\n", get_type_size_bytes(tp));
+       fprintf(F, "  alignment:  %2u Bytes,\n", get_type_alignment_bytes(tp));
        if (is_atomic_type(tp) || is_Method_type(tp))
                fprintf(F, "  mode:       %s,\n",  get_mode_name(get_type_mode(tp)));