/*---------------------------------------------------------------------------*/ void nggen_warning_at_node( expr x, char *fmt, ... ) { va_list args; nggen_where(EXPR_LINENO(x)); fprintf(stderr, "warning:"); va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); fprintf(stderr, "\n"); fflush(stderr); }
/*---------------------------------------------------------------------------*/ void nggen_error_at_node( expr x, char *fmt, ... ) { va_list args; ++nerrors_g; /* update(+1) to nerrors_g */ va_start(args, fmt); if (x != NULL) { nggen_where((int)EXPR_LINENO(x)); /* , "ErrorAtNode"); */ } vfprintf(stderr, fmt, args); va_end(args); fprintf(stderr, "\n" ); fflush(stderr); if ( nerrors_g > 30 ) { /* give the compiler the benefit of the doubt */ fprintf(stderr, "too many error, cannot recover from earlier errors: goodbye!\n" ); exit(1); } }
void dump_stmt (dump_info_p di, tree t) { if (EXPR_HAS_LOCATION (t)) dump_int (di, "line", EXPR_LINENO (t)); }
void gcc_dump_stmt (dump_info_p di, const_tree t) { if (EXPR_HAS_LOCATION (t)) gcc_dump_int (di, "line", EXPR_LINENO (t)); }
static unsigned int on_execute_pass(void) { basic_block bb; gimple_stmt_iterator gsi; const char* name; const char* file = EXPR_FILENAME(cfun->decl); const unsigned int line = EXPR_LINENO(cfun->decl); TRACE(); if (DECL_ASSEMBLER_NAME(cfun->decl) == NULL) { printf("--- skipping anonymous function\n"); return 0; } name = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(cfun->decl)); #if 0 /* debug */ printf("--- passing on function: %s\n", name); #endif track_pragmed_func(file, line, name); FOR_EACH_BB(bb) { for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) { const_gimple stmt = gsi_stmt(gsi); const enum gimple_code code = gimple_code(stmt); if (code == GIMPLE_CALL) { const char* const name = get_called_name(stmt); const tracked_func_t* const tf = find_tracked_func(name); printf("CALL%s: %s()\n", tf ? "_TASK" : "", name); if (tf != NULL) handle_task_call(gsi, tf); } #if 0 /* debug */ if (gimple_has_location(stmt)) { const location_t loc = gimple_location(stmt); const char* type = "STMT"; if (code == GIMPLE_CALL) printf ( "%s locus: .%s/%u.\n", type, LOCATION_FILE(loc), LOCATION_LINE(loc) ); } #endif /* debug */ } } return 0; }