Remove duplication of map_reg; fixes #1245

Both cranelift-codegen and wasmtime-debug need to map Cranelift registers to Gimli registers. Previously both crates had an almost-identical `map_reg` implementation. This change:
 - removes the wasmtime-debug implementation
 - improves the cranelift-codegen implementation with custom errors
 - exposes map_reg in `cranelift_codegen::isa::fde::map_reg` and subsequently `wasmtime_environ::isa::fde::map_reg`
This commit is contained in:
Andrew Brown
2020-03-31 12:47:43 -07:00
parent 48014e8d45
commit d3df275003
8 changed files with 43 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
use crate::transform::map_reg;
use std::collections::HashMap;
use wasmtime_environ::entity::EntityRef;
use wasmtime_environ::isa::fde::map_reg;
use wasmtime_environ::isa::{CallConv, TargetIsa};
use wasmtime_environ::wasm::DefinedFuncIndex;
use wasmtime_environ::{FrameLayoutChange, FrameLayouts};