Move backend_id to static str

This commit is contained in:
Syrus
2020-01-13 15:40:09 +01:00
parent cb5cf00442
commit a1d8b9aa5b
6 changed files with 17 additions and 11 deletions

View File

@ -32,6 +32,8 @@ use wasmer_runtime_core::{
};
use wasmparser::Type as WpType;
static BACKEND_ID: &str = "cranelift";
pub struct CraneliftModuleCodeGenerator {
isa: Box<dyn isa::TargetIsa>,
signatures: Option<Arc<Map<SigIndex, FuncSig>>>,
@ -58,8 +60,8 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
unimplemented!("cross compilation is not available for clif backend")
}
fn backend_id() -> String {
"cranelift".to_string()
fn backend_id() -> &'static str {
BACKEND_ID
}
fn check_precondition(&mut self, _module_info: &ModuleInfo) -> Result<(), CodegenError> {