GitLab will be upgraded on June 2nd 2020 at 2.00 pm (AEDT) to 3.00 pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to local Gitlab admin team.

Commit 1b6f904a authored by qinsoon's avatar qinsoon

move constants of prologue/epilogue name to compiler/mod.rs (instead of

in the backend)
parent 89dcb164
......@@ -32,8 +32,8 @@ use runtime::entrypoints::RuntimeEntrypoint;
use compiler::CompilerPass;
use compiler::backend::PROLOGUE_BLOCK_NAME;
use compiler::backend::EPILOGUE_BLOCK_NAME;
use compiler::PROLOGUE_BLOCK_NAME;
use compiler::EPILOGUE_BLOCK_NAME;
use compiler::backend::aarch64::*;
use compiler::backend::make_block_name;
......
......@@ -30,7 +30,7 @@ use runtime::entrypoints::RuntimeEntrypoint;
use compiler::CompilerPass;
use compiler::backend::BackendType;
use compiler::backend::RegGroup;
use compiler::backend::PROLOGUE_BLOCK_NAME;
use compiler::PROLOGUE_BLOCK_NAME;
use compiler::backend::x86_64;
use compiler::backend::x86_64::CodeGenerator;
use compiler::backend::x86_64::ASMCodeGen;
......
......@@ -33,11 +33,6 @@ use num::integer::lcm;
#[cfg(feature = "aot")]
pub const AOT_EMIT_CONTEXT_FILE : &'static str = "context.S";
/// name for prologue (this is not full name, but prologue name is generated from this)
pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue";
/// name for epilogue (this is not full name, but epilogue name is generated from this)
pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue";
// type alias to make backend code more readable
pub type Reg<'a> = &'a P<Value>;
pub type Mem<'a> = &'a P<Value>;
......
......@@ -24,7 +24,7 @@ use ast::ir::*;
use ast::ptr::*;
use compiler::machine_code::CompiledFunction;
use compiler::backend::get_color_for_precolored as alias;
use compiler::backend::PROLOGUE_BLOCK_NAME;
use compiler::PROLOGUE_BLOCK_NAME;
mod alive_entry;
use compiler::backend::reg_alloc::validate::alive_entry::*;
......
......@@ -29,6 +29,11 @@ pub mod machine_code;
pub use compiler::passes::CompilerPass;
/// name for prologue (this is not full name, but prologue name is generated from this)
pub const PROLOGUE_BLOCK_NAME: &'static str = "prologue";
/// name for epilogue (this is not full name, but epilogue name is generated from this)
pub const EPILOGUE_BLOCK_NAME: &'static str = "epilogue";
/// Zebu compiler
pub struct Compiler<'vm> {
/// policy decides what passes to be executed
......
......@@ -17,6 +17,7 @@ use ast::inst::*;
use ast::ptr::*;
use vm::VM;
use compiler::CompilerPass;
use compiler::EPILOGUE_BLOCK_NAME;
use std::any::Any;
/// Mu IR the client gives us may contain several RET instructions. However,
......@@ -49,7 +50,7 @@ impl CompilerPass for RetSink {
// create a return sink
let return_sink = {
let block_name = format!("{}:epilogue", func.name());
let block_name = format!("{}:{}", func.name(), EPILOGUE_BLOCK_NAME);
trace!("created return sink {}", block_name);
let mut block = Block::new(MuEntityHeader::named(vm.next_id(), block_name));
......
Markdown is supported
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