+2004-09-10 Paolo Bonzini <bonzini@gnu.org>
+
+ * cgraph.h (cgraph_dump_file): Do not declare.
+ * cgraphunit.c (cgraph_dump_file): Declare as static.
+ (init_cgraph): New.
+ * toplev.c (cgraph_dump_file): Do not declare.
+ (compile_file): Call init_cgraph.
+ * tree-dump.c (dump_files): Add IPA dump file, remove
+ XML dump of call graph.
+ (get_dump_file_name): Support IPA dump file naming scheme.
+ * tree.h (enum tree_dump_index): Add IPA dump file, remove
+ XML dump of call graph.
+ * doc/invoke.texi (Debugging Options): Document the new options.
+
2004-09-10 Richard Sandiford <rsandifo@redhat.com>
* doc/extend.texi: Document the FR-V built-in functions.
extern GTY(()) int cgraph_max_uid;
extern bool cgraph_global_info_ready;
extern GTY(()) struct cgraph_node *cgraph_nodes_queue;
-extern FILE *cgraph_dump_file;
extern GTY(()) int cgraph_varpool_n_nodes;
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
void cgraph_mark_inline_edge (struct cgraph_edge *e);
void cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate);
void cgraph_build_static_cdtor (char which, tree body, int priority);
+void init_cgraph (void);
#endif /* GCC_CGRAPH_H */
cgraph_decide_inlining implements heuristics taking whole callgraph
into account, while cgraph_decide_inlining_incrementally considers
only one function at a time and is used in non-unit-at-a-time mode. */
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
record_calls_1. */
static htab_t visited_nodes;
+static FILE *cgraph_dump_file;
+
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
configury, or (if not doing unit-at-a-time) to something we havn't
fn (XEXP (DECL_RTL (decl), 0), priority);
}
}
+
+void
+init_cgraph (void)
+{
+ cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
+}
@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
-fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
+-fdump-ipa-all -fdump-ipa-cgraph @gol
-fdump-tree-all @gol
-fdump-tree-original@r{[}-@var{n}@r{]} @gol
-fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
@var{options} controls the details of the dump as described for the
@option{-fdump-tree} options.
+@item -fdump-ipa-@var{switch}
+@opindex fdump-ipa
+Control the dumping at various stages of inter-procedural analyisis
+language tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. The following dumps are possible:
+
+@table @samp
+@item all
+Enables all inter-procedural analysis dumps; currently the only produced
+dump is the @samp{cgraph} dump.
+
+@item cgraph
+Dumps information about call-graph optimization, unused function removal,
+and inlining decisions.
+@end table
+
@item -fdump-tree-@var{switch} @r{(C and C++ only)}
@itemx -fdump-tree-@var{switch}-@var{options} @r{(C and C++ only)}
@opindex fdump-tree
FILE *asm_out_file;
FILE *aux_info_file;
FILE *dump_file = NULL;
-FILE *cgraph_dump_file = NULL;
char *dump_file_name;
/* The current working directory of a translation. It's generally the
{
/* Initialize yet another pass. */
+ init_cgraph ();
init_final (main_input_filename);
coverage_init (aux_base_name);
{".nested", "tree-nested", TDF_TREE, 0, 4, 0},
{".inlined", "tree-inlined", TDF_TREE, 0, 5, 0},
{".vcg", "tree-vcg", TDF_TREE, 0, 6, 0},
- /* FIXME -fdump-call-graph is broken. Set TDF_TREE when it is fixed. */
- {".xml", "call-graph", 0, 0, 7, 0},
{NULL, "tree-all", TDF_TREE, 0, 0, 0},
{NULL, "rtl-all", TDF_RTL, 0, 0, 0},
+ {NULL, "ipa-all", TDF_IPA, 0, 0, 0},
+
+ { ".cgraph", "ipa-cgraph", TDF_IPA, 0, 1, 0},
{ ".sibling", "rtl-sibling", TDF_RTL, 0, 1, 'i'},
{ ".eh", "rtl-eh", TDF_RTL, 0, 2, 'h'},
if (dfi->state == 0)
return NULL;
- if (dfi->num < 0
- || snprintf (dump_id, sizeof (dump_id), ".%s%02d",
- (dfi->flags & TDF_TREE) ? "t" : "", dfi->num) < 0)
+ if (dfi->num < 0)
dump_id[0] = '\0';
+ else
+ {
+ const char *template;
+ if (dfi->flags & TDF_TREE)
+ template = ".t%02d";
+ else if (dfi->flags & TDF_IPA)
+ template = ".i%02d";
+ else
+ template = ".%02d";
+
+ if (snprintf (dump_id, sizeof (dump_id), template, dfi->num) < 0)
+ dump_id[0] = '\0';
+ }
return concat (dump_base_name, dump_id, dfi->suffix, NULL);
}
within it. */
TDI_vcg, /* create a VCG graph file for each
function's flowgraph. */
- TDI_xml, /* dump function call graph. */
TDI_tree_all, /* enable all the GENERIC/GIMPLE dumps. */
TDI_rtl_all, /* enable all the RTL dumps. */
+ TDI_ipa_all, /* enable all the IPA dumps. */
+
+ TDI_cgraph, /* dump function call graph. */
DFI_MIN, /* For now, RTL dumps are placed here. */
DFI_sibling = DFI_MIN,
#define TDF_TREE (1 << 9) /* is a tree dump */
#define TDF_RTL (1 << 10) /* is a RTL dump */
+#define TDF_IPA (1 << 11) /* is an IPA dump */
typedef struct dump_info *dump_info_p;