* @brief Write text representation of firm to file.
* @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Hubert Schmidt,
* Matthias Braun
- * @version $Id$
*/
#include "config.h"
return verbosity;
}
-/* Write the irnode and all its attributes to the file passed. */
-void dump_irnode_to_file(FILE *F, ir_node *n)
+void dump_irnode_to_file(FILE *F, const ir_node *n)
{
char comma;
ir_graph *irg;
/* Source types */
switch (get_irn_opcode(n)) {
case iro_Block: {
- if (has_Block_entity(n))
- fprintf(F, " Label: %lu\n", get_entity_label(get_Block_entity(n)));
+ ir_entity *const entity = get_Block_entity(n);
+ if (entity != NULL)
+ fprintf(F, " Label: %lu\n", get_entity_label(entity));
fprintf(F, " block visited: %lu\n", get_Block_block_visited(n));
fprintf(F, " block marked: %u\n", get_Block_mark(n));
if (is_irg_state(get_irn_irg(n), IR_GRAPH_STATE_CONSISTENT_DOMINANCE)) {
} break;
case iro_Call: {
ir_type *tp = get_Call_type(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) {
size_t i;
fprintf(F, " entity: ");
dump_entity_to_file(F, get_SymConst_entity(n));
break;
- case symconst_type_tag:
- fprintf(F, " kind: type_tag\n");
- fprintf(F, " type: ");
- dump_type_to_file(F, get_SymConst_type(n));
- break;
case symconst_type_size:
fprintf(F, " kind: size\n");
fprintf(F, " type: ");
if (get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_inconsistent )
- if (get_irn_typeinfo_type(n) != firm_none_type)
+ if (get_irn_typeinfo_type(n) != get_none_type())
ir_fprintf (F, " Analysed type: %s\n", get_irn_typeinfo_type(n));
}
n = get_initializer_compound_n_entries(init);
for (i = 0; i != n; ++i) {
ir_initializer_t const* const val = get_initializer_compound_value(init, i);
- ir_tarval* const tv = get_initializer_tarval_value(val);
+ ir_tarval* tv;
long v;
+ if (get_initializer_kind(val) != IR_INITIALIZER_TARVAL)
+ return false;
+ tv = get_initializer_tarval_value(val);
+
if (!tarval_is_constant(tv))
return false;