absyntax_utils/debug_ast.cc
changeset 736 a591ed23c370
parent 735 0304ff59fd7f
child 767 e7d6619f6145
equal deleted inserted replaced
735:0304ff59fd7f 736:a591ed23c370
   111       if (i < symbol->candidate_datatypes.size())
   111       if (i < symbol->candidate_datatypes.size())
   112         fprintf(stderr, " %s,", symbol->candidate_datatypes[i]->absyntax_cname());
   112         fprintf(stderr, " %s,", symbol->candidate_datatypes[i]->absyntax_cname());
   113       else
   113       else
   114         fprintf(stderr, "\t\t\t");
   114         fprintf(stderr, "\t\t\t");
   115   } else {
   115   } else {
   116     fprintf(stderr, "(%ld)\t\t\t\t\t", symbol->candidate_datatypes.size());
   116     fprintf(stderr, "(%lu)\t\t\t\t\t", (unsigned long int)symbol->candidate_datatypes.size());
   117   }
   117   }
   118   fprintf(stderr, "}\t");         
   118   fprintf(stderr, "}\t");         
   119   
   119   
   120   /* print the const values... */
   120   /* print the const values... */
   121   fprintf(stderr, " constv{f=%f, i=%lld, u=%llu, b=%d}\t", symbol->const_value._real64.value, symbol->const_value._int64.value, symbol->const_value._uint64.value, symbol->const_value._bool.value);
   121   fprintf(stderr, " constv{f=%f, i=%"PRId64", u=%"PRIu64", b=%d}\t", symbol->const_value._real64.value, symbol->const_value._int64.value, symbol->const_value._uint64.value, symbol->const_value._bool.value?1:0);
   122   
   122   
   123 }
   123 }
   124 
   124 
   125 
   125 
   126 
   126 
   127 void *print_symbol_c::visit(il_instruction_c *symbol) {
   127 void *print_symbol_c::visit(il_instruction_c *symbol) {
   128    dump_symbol(symbol);
   128    dump_symbol(symbol);
   129 
   129 
   130   fprintf(stderr, "  next_il_=%ld ", symbol->next_il_instruction.size());
   130    /* NOTE: std::map.size() returns a size_type, whose type is dependent on compiler/platform. To be portable, we need to do an explicit type cast. */
   131   fprintf(stderr, "  prev_il_=%ld ", symbol->prev_il_instruction.size());
   131   fprintf(stderr, "  next_il_=%lu ", (unsigned long int)symbol->next_il_instruction.size());
       
   132   fprintf(stderr, "  prev_il_=%lu ", (unsigned long int)symbol->prev_il_instruction.size());
   132   
   133   
   133   if (symbol->prev_il_instruction.size() == 0)
   134   if (symbol->prev_il_instruction.size() == 0)
   134     fprintf(stderr, "(----,");
   135     fprintf(stderr, "(----,");
   135   else if (symbol->prev_il_instruction[0]->datatype == NULL)
   136   else if (symbol->prev_il_instruction[0]->datatype == NULL)
   136     fprintf(stderr, "(NULL,");
   137     fprintf(stderr, "(NULL,");