2012-10-06 Janus Weil <janus@gcc.gnu.org>
[official-gcc.git] / gcc / dumpfile.h
blob87a2c728623b6668b9fb6129890596abb1a4a560
1 /* Definitions for the shared dumpfile.
2 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
22 #ifndef GCC_DUMPFILE_H
23 #define GCC_DUMPFILE_H 1
25 #include "line-map.h"
27 /* Different tree dump places. When you add new tree dump places,
28 extend the DUMP_FILES array in tree-dump.c. */
29 enum tree_dump_index
31 TDI_none, /* No dump */
32 TDI_cgraph, /* dump function call graph. */
33 TDI_tu, /* dump the whole translation unit. */
34 TDI_class, /* dump class hierarchy. */
35 TDI_original, /* dump each function before optimizing it */
36 TDI_generic, /* dump each function after genericizing it */
37 TDI_nested, /* dump each function after unnesting it */
38 TDI_vcg, /* create a VCG graph file for each
39 function's flowgraph. */
40 TDI_tree_all, /* enable all the GENERIC/GIMPLE dumps. */
41 TDI_rtl_all, /* enable all the RTL dumps. */
42 TDI_ipa_all, /* enable all the IPA dumps. */
44 TDI_end
47 /* Bit masks to control dumping. Not all values are applicable to all
48 dumps. Add new ones at the end. When you define new values, extend
49 the DUMP_OPTIONS array in tree-dump.c. The TDF_* flags coexist with
50 MSG_* flags (for -fopt-info) and the bit values must be chosen
51 to allow that. */
52 #define TDF_ADDRESS (1 << 0) /* dump node addresses */
53 #define TDF_SLIM (1 << 1) /* don't go wild following links */
54 #define TDF_RAW (1 << 2) /* don't unparse the function */
55 #define TDF_DETAILS (1 << 3) /* show more detailed info about
56 each pass */
57 #define TDF_STATS (1 << 4) /* dump various statistics about
58 each pass */
59 #define TDF_BLOCKS (1 << 5) /* display basic block boundaries */
60 #define TDF_VOPS (1 << 6) /* display virtual operands */
61 #define TDF_LINENO (1 << 7) /* display statement line numbers */
62 #define TDF_UID (1 << 8) /* display decl UIDs */
64 #define TDF_TREE (1 << 9) /* is a tree dump */
65 #define TDF_RTL (1 << 10) /* is a RTL dump */
66 #define TDF_IPA (1 << 11) /* is an IPA dump */
67 #define TDF_STMTADDR (1 << 12) /* Address of stmt. */
69 #define TDF_GRAPH (1 << 13) /* a graph dump is being emitted */
70 #define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr.
71 Implies TDF_VOPS. */
73 #define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
74 message. */
75 #define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
76 dumper to print stmts. */
77 #define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
78 a gimple stmt. */
79 #define TDF_ASMNAME (1 << 18) /* display asm names of decls */
80 #define TDF_EH (1 << 19) /* display EH region number
81 holding this gimple statement. */
82 #define TDF_NOUID (1 << 20) /* omit UIDs from dumps. */
83 #define TDF_ALIAS (1 << 21) /* display alias information */
84 #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
85 #define TDF_CSELIB (1 << 23) /* Dump cselib details. */
86 #define TDF_SCEV (1 << 24) /* Dump SCEV details. */
87 #define TDF_COMMENT (1 << 25) /* Dump lines with prefix ";;" */
88 #define MSG_OPTIMIZED_LOCATIONS (1 << 26) /* -fopt-info optimized sources */
89 #define MSG_MISSED_OPTIMIZATION (1 << 27) /* missed opportunities */
90 #define MSG_NOTE (1 << 28) /* general optimization info */
91 #define MSG_ALL (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
92 | MSG_NOTE)
94 /* Define a tree dump switch. */
95 struct dump_file_info
97 const char *suffix; /* suffix to give output file. */
98 const char *swtch; /* command line dump switch */
99 const char *glob; /* command line glob */
100 const char *pfilename; /* filename for the pass-specific stream */
101 const char *alt_filename; /* filename for the opt-info stream */
102 FILE *pstream; /* pass-specific dump stream */
103 FILE *alt_stream; /* opt-info stream */
104 int pflags; /* dump flags */
105 int alt_flags; /* flags for opt-info */
106 int pstate; /* state of pass-specific stream */
107 int alt_state; /* state of the opt-info stream */
108 int num; /* dump file number */
112 /* In dumpfile.c */
113 extern char *get_dump_file_name (int);
114 extern int dump_initialized_p (int);
115 extern FILE *dump_begin (int, int *);
116 extern void dump_end (int, FILE *);
117 extern int dump_start (int, int *);
118 extern void dump_finish (int);
119 extern void dump_node (const_tree, int, FILE *);
120 extern int dump_switch_p (const char *);
121 extern int opt_info_switch_p (const char *);
122 extern const char *dump_flag_name (int);
123 extern bool dump_kind_p (int);
124 extern void dump_printf (int, const char *, ...) ATTRIBUTE_PRINTF_2;
125 extern void dump_printf_loc (int, source_location,
126 const char *, ...) ATTRIBUTE_PRINTF_3;
127 extern void dump_basic_block (int, basic_block, int);
128 extern void dump_generic_expr_loc (int, source_location, int, tree);
129 extern void dump_generic_expr (int, int, tree);
130 extern void dump_gimple_stmt_loc (int, source_location, int, gimple, int);
131 extern void dump_gimple_stmt (int, int, gimple, int);
132 extern void print_combine_total_stats (void);
133 extern unsigned int dump_register (const char *, const char *, const char *,
134 int);
135 extern bool enable_rtl_dump_file (void);
137 /* In combine.c */
138 extern void dump_combine_total_stats (FILE *);
139 /* In cfghooks.c */
140 extern void dump_bb (FILE *, basic_block, int, int);
142 /* Global variables used to communicate with passes. */
143 extern FILE *dump_file;
144 extern int dump_flags;
145 extern const char *dump_file_name;
147 /* Return the dump_file_info for the given phase. */
148 extern struct dump_file_info *get_dump_file_info (int);
150 #endif /* GCC_DUMPFILE_H */