#include "trouts.h"
#include "irgwalk.h"
#include "tv_t.h"
+#include "vrp.h"
#include "irprintf.h"
#include "error.h"
* @param suffix2 The second suffix.
* @param suffix3 The third suffix.
*/
-static FILE *text_open(const char *basename, const char * suffix1, const char *suffix2, const char *suffix3) {
+static FILE *text_open(const char *basename, const char * suffix1, const char *suffix2, const char *suffix3)
+{
FILE *F;
int len = strlen(basename), i, j;
char *fname; /* filename to put the vcg information in */
}
/* Write the irnode and all its attributes to the file passed. */
-int dump_irnode_to_file(FILE *F, ir_node *n) {
- int i, bad = 0;
- char comma;
+int dump_irnode_to_file(FILE *F, ir_node *n)
+{
+ int i, bad = 0;
+ char comma;
ir_graph *irg;
+ vrp_attr *vrp_info;
dump_node_opcode(F, n);
fprintf(F, " %ld\n", get_irn_node_nr(n));
if (get_Call_tail_call(n))
fprintf(F, " tail call\n");
ir_fprintf(F, " calling method of type %+F\n", tp);
- if(get_unknown_type() != tp) {
+ if (get_unknown_type() != tp) {
for (i = 0; i < get_method_n_params(tp); ++i)
ir_fprintf(F, " param %d type: %+F\n", i, get_method_param_type(tp, i));
for (i = 0; i < get_method_n_ress(tp); ++i)
ir_fprintf(F, " Const of type %+F\n", get_Const_type(n));
} break;
case iro_SymConst: {
- switch(get_SymConst_kind(n)) {
- case symconst_addr_name:
- fprintf(F, " kind: addr_name\n");
- fprintf(F, " name: %s\n", get_id_str(get_SymConst_name(n)));
- break;
+ switch (get_SymConst_kind(n)) {
case symconst_addr_ent:
fprintf(F, " kind: addr_ent\n");
fprintf(F, " entity: ");
fprintf(F, "\n volatile");
fprintf(F, "\n");
} break;
- default: ;
+
+ default:
+ break;
+ }
+
+ vrp_info = vrp_get_info(n);
+ if (vrp_info) {
+ dump_vrp_info(F, n);
}
if (get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_consistent ||
-void dump_irnode(ir_node *n) {
+void dump_irnode(ir_node *n)
+{
dump_irnode_to_file(stdout, n);
}
-void dump_graph_to_file(FILE *F, ir_graph *irg) {
+void dump_graph_to_file(FILE *F, ir_graph *irg)
+{
fprintf(F, "graph %s\n", get_irg_dump_name(irg));
}
-void dump_graph(ir_graph *g) {
+void dump_graph(ir_graph *g)
+{
dump_graph_to_file(stdout, g);
}
-static void dump_node_to_graph_file(ir_node *n, void *env) {
+static void dump_node_to_graph_file(ir_node *n, void *env)
+{
FILE *F = (FILE *)env;
dump_irnode_to_file(F, n);
fprintf(F, "\n");
}
-void dump_graph_as_text(ir_graph *irg, const char *suffix) {
+void dump_graph_as_text(ir_graph *irg, const char *suffix)
+{
const char *basename = get_irg_dump_name(irg);
FILE *F;
}
#ifdef EXTENDED_ACCESS_STATS
-static int addr_is_alloc(ir_node *acc) {
+static int addr_is_alloc(ir_node *acc)
+{
ir_node *addr = NULL;
ir_opcode addr_op;
if (is_memop(acc)) {
static void dump_node_list(FILE *F, firm_kind *k, char *prefix,
int (*get_entity_n_nodes)(firm_kind *ent),
ir_node *(*get_entity_node)(firm_kind *ent, int pos),
- char *name) {
+ char *name)
+{
int i, n_nodes = get_entity_n_nodes(k);
char *comma = "";
static void dump_type_list(FILE *F, ir_type *tp, char *prefix,
int (*get_n_types)(const ir_type *tp),
ir_type *(*get_type)(const ir_type *tp, int pos),
- const char *name) {
+ const char *name)
+{
int i, n_nodes = get_n_types(tp);
char *comma = "";
* Dump initializers.
*/
static void dump_ir_initializers_to_file(FILE *F, const char *prefix,
- const ir_initializer_t *initializer, ir_type *type) {
+ const ir_initializer_t *initializer, ir_type *type)
+{
tarval *tv;
ir_node *value;
fprintf(F, " constant");
if (linkage & IR_LINKAGE_WEAK)
fprintf(F, " weak");
- if (linkage & IR_LINKAGE_LOCAL)
- fprintf(F, " local");
- if (linkage & IR_LINKAGE_EXTERN)
- fprintf(F, " extern");
if (linkage & IR_LINKAGE_GARBAGE_COLLECT)
fprintf(F, " garbage_collect");
if (linkage & IR_LINKAGE_MERGE)
fprintf(F, " hidden_user");
}
-void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned verbosity) {
+void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned verbosity)
+{
int i, j;
ir_type *owner, *type;
if (mask & mtp_property_nothrow) fputs("nothrow_function, ", F);
if (mask & mtp_property_naked) fputs("naked_function, ", F);
if (mask & mtp_property_malloc) fputs("malloc_function, ", F);
- if (mask & mtp_property_weak) fputs("weak_function, ", F);
if (mask & mtp_property_returns_twice) fputs("weak_function, ", F);
if (mask & mtp_property_intrinsic) fputs("intrinsic_function, ", F);
if (mask & mtp_property_runtime) fputs("runtime_function, ", F);
}
}
-void dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity) {
+void dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity)
+{
dump_entity_to_file_prefix (F, ent, "", verbosity);
fprintf(F, "\n");
}
-void dump_entity(ir_entity *ent) {
+void dump_entity(ir_entity *ent)
+{
dump_entity_to_file(stdout, ent, dump_verbosity_max);
}
-void dump_type_to_file(FILE *F, ir_type *tp, dump_verbosity verbosity) {
+void dump_type_to_file(FILE *F, ir_type *tp, dump_verbosity verbosity)
+{
int i;
if ((is_Class_type(tp)) && (verbosity & dump_verbosity_noClassTypes)) return;
fprintf(F, "\n\n");
}
-void dump_type(ir_type *tp) {
+void dump_type(ir_type *tp)
+{
dump_type_to_file (stdout, tp, dump_verbosity_max);
}
-void dump_types_as_text(unsigned verbosity, const char *suffix) {
+void dump_types_as_text(unsigned verbosity, const char *suffix)
+{
const char *basename;
FILE *F;
int i, n_types = get_irp_n_types();
fclose(F);
}
-void dump_globals_as_text(unsigned verbosity, const char *suffix) {
+void dump_globals_as_text(unsigned verbosity, const char *suffix)
+{
const char *basename;
FILE *F;
ir_type *g = get_glob_type();