projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typos in comments: s/wether/whether/ and related corrections.
[libfirm]
/
ir
/
be
/
bemain.c
diff --git
a/ir/be/bemain.c
b/ir/be/bemain.c
index
72ffb7b
..
9d63372
100644
(file)
--- a/
ir/be/bemain.c
+++ b/
ir/be/bemain.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-20
08
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-20
11
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-73,6
+73,7
@@
#include "be_dbgout.h"
#include "beirg.h"
#include "bestack.h"
#include "be_dbgout.h"
#include "beirg.h"
#include "bestack.h"
+#include "beemitter.h"
#define NEW_ID(s) new_id_from_chars(s, sizeof(s) - 1)
#define NEW_ID(s) new_id_from_chars(s, sizeof(s) - 1)
@@
-362,7
+363,6
@@
static be_main_env_t *be_init_env(be_main_env_t *env, FILE *file_handle)
memset(asm_constraint_flags, 0, sizeof(asm_constraint_flags));
env->arch_env = arch_env_init(isa_if, file_handle, env);
memset(asm_constraint_flags, 0, sizeof(asm_constraint_flags));
env->arch_env = arch_env_init(isa_if, file_handle, env);
- be_dbg_open();
return env;
}
return env;
}
@@
-371,9
+371,6
@@
static be_main_env_t *be_init_env(be_main_env_t *env, FILE *file_handle)
*/
static void be_done_env(be_main_env_t *env)
{
*/
static void be_done_env(be_main_env_t *env)
{
- arch_env_done(env->arch_env);
- be_dbg_close();
-
pmap_destroy(env->ent_trampoline_map);
pmap_destroy(env->ent_pic_symbol_map);
free_type(env->pic_trampolines_type);
pmap_destroy(env->ent_trampoline_map);
pmap_destroy(env->ent_pic_symbol_map);
free_type(env->pic_trampolines_type);
@@
-469,17
+466,28
@@
ir_timer_t *be_timers[T_LAST+1];
void be_lower_for_target(void)
{
void be_lower_for_target(void)
{
-
in
t i;
+
size_
t i;
isa_if->lower_for_target();
/* set the phase to low */
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);
+ for (i = get_irp_n_irgs()
; i > 0;
) {
+ ir_graph *irg = get_irp_irg(
--
i);
set_irg_phase_state(irg, phase_low);
}
set_irp_phase_state(phase_low);
}
set_irg_phase_state(irg, phase_low);
}
set_irp_phase_state(phase_low);
}
+static void emit_global_asms(void)
+{
+ size_t n = get_irp_n_asms();
+ size_t i;
+ for (i = 0; i < n; ++i) {
+ be_emit_cstring("#APP\n");
+ be_emit_ident(get_irp_asm(i));
+ be_emit_cstring("\n#NO_APP\n");
+ }
+}
+
/**
* The Firm backend main loop.
* Do architecture specific lowering for all graphs
/**
* The Firm backend main loop.
* Do architecture specific lowering for all graphs
@@
-492,7
+500,8
@@
static void be_main_loop(FILE *file_handle, const char *cup_name)
{
static const char suffix[] = ".prof";
{
static const char suffix[] = ".prof";
- int i, num_birgs, stat_active = 0;
+ size_t i, num_birgs;
+ int stat_active = 0;
be_main_env_t env;
char prof_filename[256];
be_irg_t *birgs;
be_main_env_t env;
char prof_filename[256];
be_irg_t *birgs;
@@
-510,9
+519,12
@@
static void be_main_loop(FILE *file_handle, const char *cup_name)
be_init_env(&env, file_handle);
env.cup_name = cup_name;
be_init_env(&env, file_handle);
env.cup_name = cup_name;
- be_dbg_so(cup_name);
+ be_dbg_open();
+ be_dbg_unit_begin(cup_name);
be_dbg_types();
be_dbg_types();
+ emit_global_asms();
+
arch_env = env.arch_env;
/* backend may provide an ordered list of irgs where code should be
arch_env = env.arch_env;
/* backend may provide an ordered list of irgs where code should be
@@
-799,6
+811,12
@@
static void be_main_loop(FILE *file_handle, const char *cup_name)
be_free_birg(irg);
stat_ev_ctx_pop("bemain_irg");
}
be_free_birg(irg);
stat_ev_ctx_pop("bemain_irg");
}
+
+ arch_env_done(arch_env);
+
+ be_dbg_unit_end();
+ be_dbg_close();
+
ir_profile_free();
be_done_env(&env);
ir_profile_free();
be_done_env(&env);