#include "pset.h"
#if DO_HEAPANALYSIS
-void dump_irn_chi_term(FILE *FL, ir_node *n);
-void dump_irn_state(FILE *FL, ir_node *n);
-int get_opt_dump_abstvals(void);
+extern void dump_irn_chi_term(FILE *FL, ir_node *n);
+extern void dump_irn_state(FILE *FL, ir_node *n);
+extern int get_opt_dump_abstvals(void);
typedef unsigned long SeqNo;
-SeqNo get_Block_seqno(ir_node *n);
+extern SeqNo get_Block_seqno(ir_node *n);
#endif
/* basis for a color range for vcg */
/* strncpy (fname, nm, len); */ /* copy the filename */
j = 0;
- for (i = 0; i < len; ++i) { /* replase '/' in the name: escape by @. */
+ for (i = 0; i < len; ++i) { /* replace '/' in the name: escape by @. */
if (nm[i] == '/') {
fname[j] = '@'; j++; fname[j] = '1'; j++;
} else if (nm[i] == '@') {
strcat (fname, suffix1); /* append file suffix */
strcat (fname, suffix2); /* append file suffix */
strcat (fname, ".vcg"); /* append the .vcg suffix */
- F = fopen (fname, "w"); /* open file for writing */
+
+ /* vcg really expect only a <CR> at end of line, so
+ * the "b"inary mode is what you mean (and even needed for Win32)
+ */
+ F = fopen (fname, "wb"); /* open file for writing */
if (!F) {
panic("cannot open %s for writing (%m)", fname); /* not reached */
}
fname = malloc (len * 2 + 5 + strlen(suffix));
/* strcpy (fname, name);*/ /* copy the filename */
j = 0;
- for (i = 0; i < len; ++i) { /* replase '/' in the name: escape by @. */
+ for (i = 0; i < len; ++i) { /* replace '/' in the name: escape by @. */
if (name[i] == '/') {
fname[j] = '@'; j++; fname[j] = '1'; j++;
} else if (name[i] == '@') {
fname[j] = '\0';
strcat (fname, suffix);
strcat (fname, ".vcg"); /* append the .vcg suffix */
- F = fopen (fname, "w"); /* open file for writing */
+
+ /* vcg really expect only a <CR> at end of line, so
+ * the "b"inary mode is what you mean (and even needed for Win32)
+ */
+ F = fopen (fname, "wb"); /* open file for writing */
if (!F) {
panic ("cannot open %s for writing (%m)", fname); /* not reached */
}
/************************************************************************/
/************************************************************************/
-/* Dump ir graphs, differnt formats and additional information. */
+/* Dump ir graphs, different formats and additional information. */
/************************************************************************/
/** Routine to dump a graph, blocks as conventional nodes. */
rem = current_ir_graph;
if (strncmp(get_entity_name(get_irg_entity(irg)),
- dump_file_filter, strlen(dump_file_filter)) != 0) return;
+ dump_file_filter, strlen(dump_file_filter)) != 0) return;
current_ir_graph = irg;
if (get_interprocedural_view()) suffix1 = "-pure-ip";
PRINT_NODEID(block);
fprintf (F, "\" ");
fprintf(F, "info1:\"");
- if (dump_dominator_information_flag)
+ if (dump_dominator_information_flag) {
fprintf(F, "dom depth %d\n", get_Block_dom_depth(block));
+ fprintf(F, "tree pre num %d\n", get_Block_dom_tree_pre_num(block));
+ fprintf(F, "max subtree pre num %d\n", get_Block_dom_max_subtree_pre_num(block));
+ }
/* show arity and possible Bad predecessors of the block */
fprintf(F, "arity: %d\n", get_Block_n_cfgpreds(block));
/* walk over the blocks in the graph */
type_walk_irg(irg, dump_type_info, NULL, f);
/* The walker for the const code can be called several times for the
- same (sub) experssion. So that no nodes are dumped several times
+ same (sub) expression. So that no nodes are dumped several times
we decrease the visited flag of the corresponding graph after each
walk. So now increase it finally. */
inc_irg_visited(get_const_code_irg());