libFirm 1.20
|
00001 /* 00002 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. 00003 * 00004 * This file is part of libFirm. 00005 * 00006 * This file may be distributed and/or modified under the terms of the 00007 * GNU General Public License version 2 as published by the Free Software 00008 * Foundation and appearing in the file LICENSE.GPL included in the 00009 * packaging of this file. 00010 * 00011 * Licensees holding valid libFirm Professional Edition licenses may use 00012 * this file in accordance with the libFirm Commercial License. 00013 * Agreement provided with the Software. 00014 * 00015 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00017 * PURPOSE. 00018 */ 00019 00027 #ifndef FIRM_IR_IRDUMP_H 00028 #define FIRM_IR_IRDUMP_H 00029 00030 #include <stdio.h> 00031 00032 #include "firm_types.h" 00033 #include "begin.h" 00034 00059 FIRM_API void dump_ir_graph(ir_graph *graph, const char *suffix); 00060 00064 typedef void (*ir_prog_dump_func)(FILE *out); 00065 00079 FIRM_API void dump_ir_prog_ext(ir_prog_dump_func func, const char *suffix); 00080 00084 typedef void (*ir_graph_dump_func)(FILE *out, ir_graph *graph); 00085 00098 FIRM_API void dump_ir_graph_ext(ir_graph_dump_func func, ir_graph *graph, 00099 const char *suffix); 00100 00106 FIRM_API void dump_all_ir_graphs(const char *suffix); 00107 00111 FIRM_API void ir_set_dump_path(const char *path); 00112 00122 FIRM_API void ir_set_dump_filter(const char *name); 00123 00125 FIRM_API const char *ir_get_dump_filter(void); 00126 00128 FIRM_API int ir_should_dump(const char *name); 00129 00138 FIRM_API ir_prog_pass_t *dump_all_ir_graph_pass(const char *name, 00139 const char *suffix); 00140 00150 FIRM_API void dump_ir_graph_file(FILE *out, ir_graph *graph); 00151 00160 FIRM_API void dump_cfg(FILE *out, ir_graph *graph); 00161 00167 FIRM_API void dump_callgraph(FILE *out); 00168 00177 FIRM_API void dump_typegraph(FILE *out); 00178 00190 FIRM_API void dump_class_hierarchy(FILE *out); 00191 00199 FIRM_API void dump_loop_tree(FILE *out, ir_graph *graph); 00200 00206 FIRM_API void dump_callgraph_loop_tree(FILE *out); 00207 00216 FIRM_API void dump_types_as_text(FILE *out); 00217 00225 FIRM_API void dump_globals_as_text(FILE *out); 00226 00233 FIRM_API void dump_loop(FILE *out, ir_loop *loop); 00234 00237 FIRM_API void dump_graph_as_text(FILE *out, ir_graph *graph); 00238 00240 FIRM_API void dump_entity_to_file(FILE *out, ir_entity *entity); 00241 00243 FIRM_API void dump_type_to_file(FILE *out, ir_type *type); 00244 00246 typedef enum { 00247 dump_verbosity_onlynames = 0x00000001, 00249 dump_verbosity_fields = 0x00000002, 00250 dump_verbosity_methods = 0x00000004, 00251 dump_verbosity_nostatic = 0x00000040, 00254 dump_verbosity_typeattrs = 0x00000008, 00255 dump_verbosity_entattrs = 0x00000010, 00256 dump_verbosity_entconsts = 0x00000020, 00258 dump_verbosity_accessStats = 0x00000100, 00260 dump_verbosity_noClassTypes = 0x00001000, 00261 dump_verbosity_noStructTypes = 0x00002000, 00262 dump_verbosity_noUnionTypes = 0x00004000, 00263 dump_verbosity_noArrayTypes = 0x00008000, 00264 dump_verbosity_noPointerTypes = 0x00010000, 00265 dump_verbosity_noMethodTypes = 0x00020000, 00266 dump_verbosity_noPrimitiveTypes = 0x00040000, 00267 dump_verbosity_noEnumerationTypes= 0x00080000, 00269 dump_verbosity_onlyClassTypes = 0x000FE000, 00270 dump_verbosity_onlyStructTypes = 0x000FD000, 00271 dump_verbosity_onlyUnionTypes = 0x000FB000, 00272 dump_verbosity_onlyArrayTypes = 0x000F7000, 00273 dump_verbosity_onlyPointerTypes = 0x000EF000, 00274 dump_verbosity_onlyMethodTypes = 0x000DF000, 00275 dump_verbosity_onlyPrimitiveTypes = 0x000BF000, 00276 dump_verbosity_onlyEnumerationTypes=0x0007F000, 00278 dump_verbosity_max = 0x4FF00FBE 00279 } ir_dump_verbosity_t; 00280 ENUM_BITSET(ir_dump_verbosity_t) 00281 00282 00283 FIRM_API void ir_set_dump_verbosity(ir_dump_verbosity_t verbosity); 00285 FIRM_API ir_dump_verbosity_t ir_get_dump_verbosity(void); 00286 00292 typedef enum { 00294 ir_dump_flag_blocks_as_subgraphs = 1U << 0, 00296 ir_dump_flag_group_extbb = 1U << 1, 00298 ir_dump_flag_with_typegraph = 1U << 2, 00302 ir_dump_flag_disable_edge_labels = 1U << 3, 00306 ir_dump_flag_consts_local = 1U << 4, 00308 ir_dump_flag_idx_label = 1U << 5, 00310 ir_dump_flag_number_label = 1U << 6, 00312 ir_dump_flag_keepalive_edges = 1U << 7, 00314 ir_dump_flag_out_edges = 1U << 8, 00316 ir_dump_flag_dominance = 1U << 9, 00319 ir_dump_flag_loops = 1U << 10, 00321 ir_dump_flag_back_edges = 1U << 11, 00323 ir_dump_flag_analysed_types = 1U << 12, 00325 ir_dump_flag_iredges = 1U << 13, 00327 ir_dump_flag_node_addresses = 1U << 14, 00329 ir_dump_flag_all_anchors = 1U << 15, 00331 ir_dump_flag_show_marks = 1U << 16, 00332 00334 ir_dump_flag_no_entity_values = 1U << 20, 00336 ir_dump_flag_ld_names = 1U << 21, 00338 ir_dump_flag_entities_in_hierarchy = 1U << 22, 00339 } ir_dump_flags_t; 00340 ENUM_BITSET(ir_dump_flags_t) 00341 00342 00343 FIRM_API void ir_set_dump_flags(ir_dump_flags_t flags); 00345 FIRM_API void ir_add_dump_flags(ir_dump_flags_t flags); 00347 FIRM_API void ir_remove_dump_flags(ir_dump_flags_t flags); 00349 FIRM_API ir_dump_flags_t ir_get_dump_flags(void); 00350 00356 typedef int (*dump_node_vcgattr_func)(FILE *out, const ir_node *node, const ir_node *local); 00357 00363 typedef int (*dump_edge_vcgattr_func)(FILE *out, const ir_node *node, int to); 00364 00369 typedef void (*dump_node_edge_func)(FILE *out, const ir_node *node); 00370 00372 FIRM_API void set_dump_node_vcgattr_hook(dump_node_vcgattr_func hook); 00374 FIRM_API void set_dump_edge_vcgattr_hook(dump_edge_vcgattr_func hook); 00375 00380 FIRM_API void set_dump_node_edge_hook(dump_node_edge_func func); 00381 00386 FIRM_API dump_node_edge_func get_dump_node_edge_hook(void); 00387 00392 FIRM_API void set_dump_block_edge_hook(dump_node_edge_func func); 00393 00398 FIRM_API dump_node_edge_func get_dump_block_edge_hook(void); 00399 00401 typedef void (dump_node_info_cb_t)(void *data, FILE *out, const ir_node *n); 00402 00415 FIRM_API void *dump_add_node_info_callback(dump_node_info_cb_t *cb, void *data); 00416 00423 FIRM_API void dump_remove_node_info_callback(void *handle); 00424 00427 #include "end.h" 00428 00429 #endif