#include "tree-pass.h"
#include "context.h"
#include "pass_manager.h"
+#include "tree.h"
static int statistics_dump_nr;
static dump_flags_t statistics_dump_flags;
return statistics_hashes[idx];
}
+/* Helper function to return asmname or name of FN
+ depending on whether asmname option is set. */
+
+static const char *
+get_function_name (struct function *fn)
+{
+ if ((statistics_dump_flags & TDF_ASMNAME)
+ && DECL_ASSEMBLER_NAME_SET_P (fn->decl))
+ {
+ tree asmname = decl_assembler_name (fn->decl);
+ if (asmname)
+ return IDENTIFIER_POINTER (asmname);
+ }
+ return function_name (fn);
+}
+
/* Helper for statistics_fini_pass. Print the counter difference
since the last dump for the pass dump files. */
current_pass->static_pass_number,
current_pass->name,
counter->id, counter->val,
- current_function_name (),
+ get_function_name (cfun),
count);
else
fprintf (statistics_dump_file,
current_pass->static_pass_number,
current_pass->name,
counter->id,
- current_function_name (),
+ get_function_name (cfun),
count);
counter->prev_dumped_count = counter->count;
return 1;
current_pass ? current_pass->static_pass_number : -1,
current_pass ? current_pass->name : "none",
id,
- function_name (fn),
+ get_function_name (fn),
incr);
}
current_pass->static_pass_number,
current_pass->name,
id, val,
- function_name (fn));
+ get_function_name (fn));
}