summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-01-10 18:13:32 +0100
committerDavid Schleef <ds@schleef.org>2013-01-10 12:11:54 -0800
commitb4f7fcaf99a4d952e59f2a9fa9286d24cc4b3a5a (patch)
treea2670027e2f84d2602734c3636e03ca34e68b2f9
parente9825b47323ee58a95c221bc0a7b759ab0c95061 (diff)
downloadorc-b4f7fcaf99a4d952e59f2a9fa9286d24cc4b3a5a.tar.gz
orccompiler: Allow fallback to backup/emulation if the target specific register allocation failsbaserock/morph
The OrcCode of the program wouldn't be filled with all required fields if the register allocation happens to early.
-rw-r--r--orc/orccompiler.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/orc/orccompiler.c b/orc/orccompiler.c
index 68eb01e..2175206 100644
--- a/orc/orccompiler.c
+++ b/orc/orccompiler.c
@@ -254,12 +254,6 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
orc_compiler_rewrite_vars (compiler);
if (compiler->error) goto error;
- if (compiler->target) {
- orc_compiler_global_reg_alloc (compiler);
-
- orc_compiler_rewrite_vars2 (compiler);
- }
-
#if 0
{
ORC_ERROR("variables");
@@ -285,9 +279,6 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
}
}
#endif
-
- if (compiler->error) goto error;
-
program->orccode = orc_code_new ();
program->orccode->is_2d = program->is_2d;
@@ -323,6 +314,13 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
goto error;
}
+ if (compiler->target) {
+ orc_compiler_global_reg_alloc (compiler);
+
+ orc_compiler_rewrite_vars2 (compiler);
+ }
+ if (compiler->error) goto error;
+
orc_compiler_assign_rules (compiler);
if (compiler->error) goto error;