Commit 2d7248e3 authored by Matthias Braun's avatar Matthias Braun
Browse files

emit global asms in all backends

parent 63e1d96c
......@@ -73,6 +73,7 @@
#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)
......@@ -476,6 +477,17 @@ void be_lower_for_target(void)
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
......@@ -511,6 +523,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_dbg_unit_begin(cup_name);
be_dbg_types();
emit_global_asms();
arch_env = env.arch_env;
/* backend may provide an ordered list of irgs where code should be
......
......@@ -1546,14 +1546,6 @@ static arch_env_t *ia32_init(FILE *file_handle)
/* enter the ISA object into the intrinsic environment */
intrinsic_env.isa = isa;
/* emit asm includes */
n = get_irp_n_asms();
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");
}
return &isa->base;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment