static be_module_list_entry_t *isa_ifs = NULL;
-unsigned short asm_constraint_flags[256];
+asm_constraint_flags_t asm_constraint_flags[256];
void be_init_default_asm_constraint_flags(void)
{
asm_constraint_flags_t be_parse_asm_constraints(const char *constraint)
{
- asm_constraint_flags_t flags = 0;
+ asm_constraint_flags_t flags = ASM_CONSTRAINT_FLAG_NONE;
const char *c;
asm_constraint_flags_t tflags;
}
ir_timer_t *be_timers[T_LAST+1];
+void be_lower_for_target(void)
+{
+ int i;
+
+ isa_if->lower_for_target();
+ /* set the phase to low */
+ for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
+ ir_graph *irg = get_irp_irg(i);
+ set_irg_phase_state(irg, phase_low);
+ }
+ set_irp_phase_state(phase_low);
+}
+
/**
* The Firm backend main loop.
* Do architecture specific lowering for all graphs
Get the filename for the profiling data.
Beware: '\0' is already included in sizeof(suffix)
*/
- memset(prof_filename, 0, sizeof(prof_filename));
- strncpy(prof_filename, cup_name, sizeof(prof_filename) - sizeof(suffix));
- strcat(prof_filename, suffix);
+ sprintf(prof_filename, "%.*s%s\n", (int)(sizeof(prof_filename) - sizeof(suffix)), cup_name, suffix);
/*
Next: Either instruments all irgs with profiling code
arch_env->impl->before_abi(irg);
/* implement the ABI conventions. */
- be_timer_push(T_ABI);
- be_abi_introduce(irg);
- be_timer_pop(T_ABI);
-
if (!arch_env->custom_abi) {
+ be_timer_push(T_ABI);
+ be_abi_introduce(irg);
+ be_timer_pop(T_ABI);
dump(DUMP_ABI, irg, "abi");
}
dump(DUMP_FINAL, irg, "end");
- be_timer_push(T_ABI);
- be_abi_free(irg);
- be_timer_pop(T_ABI);
+ if (!arch_env->custom_abi) {
+ be_timer_push(T_ABI);
+ be_abi_free(irg);
+ be_timer_pop(T_ABI);
+ }
restore_optimization_state(&state);
be_timer_pop(T_OTHER);
if (be_timing) {
- int t;
+ be_timer_id_t t;
if (stat_ev_enabled) {
- for (t = 0; t < T_LAST+1; ++t) {
+ for (t = T_FIRST; t < T_LAST+1; ++t) {
char buf[128];
snprintf(buf, sizeof(buf), "bemain_time_%s",
get_timer_name(t));
} else {
printf("==>> IRG %s <<==\n",
get_entity_name(get_irg_entity(irg)));
- for (t = 0; t < T_LAST+1; ++t) {
+ for (t = T_FIRST; t < T_LAST+1; ++t) {
double val = ir_timer_elapsed_usec(be_timers[t]) / 1000.0;
printf("%-20s: %8.3lf msec\n", get_timer_name(t), val);
}
}
- for (t = 0; t < T_LAST+1; ++t) {
+ for (t = T_FIRST; t < T_LAST+1; ++t) {
ir_timer_stop(be_timers[t]);
ir_timer_reset(be_timers[t]);
}
static int do_lower_for_target(ir_prog *irp, void *context)
{
- const backend_params *be_params = be_get_backend_param();
- be_params->lower_for_target();
+ be_lower_for_target();
(void) context;
(void) irp;
return 0;