Update gimli version; refactor debug data structures

This commit is contained in:
Yury Delendik
2019-07-03 16:58:35 -05:00
committed by Dan Gohman
parent adadf835f0
commit efe9dd7b86
9 changed files with 120 additions and 192 deletions

View File

@@ -8,6 +8,7 @@ use cranelift_entity::PrimaryMap;
use cranelift_wasm::{DefinedFuncIndex, FuncIndex, WasmError};
use std::ops::Range;
use std::vec::Vec;
use wasmtime_debug::ModuleAddressMap;
/// Compiled machine code: body and jump table offsets.
#[derive(Debug, Clone)]
@@ -139,35 +140,6 @@ pub enum CompileError {
Codegen(CodegenError),
}
/// Single address point transform.
#[derive(Debug)]
pub struct InstructionAddressTransform {
/// Original source location.
pub srcloc: ir::SourceLoc,
/// Generated instructions offset.
pub code_offset: usize,
/// Generated instructions length.
pub code_len: usize,
}
/// Function and its instructions transforms.
#[derive(Debug)]
pub struct FunctionAddressTransform {
/// Instructions transforms
pub locations: Vec<InstructionAddressTransform>,
/// Generated function body offset if applicable, otherwise 0.
pub body_offset: usize,
/// Generated function body length.
pub body_len: usize,
}
/// Function AddressTransforms collection.
pub type AddressTransforms = PrimaryMap<DefinedFuncIndex, FunctionAddressTransform>;
/// An implementation of a compiler from parsed WebAssembly module to native code.
pub trait Compiler {
/// Compile a parsed module with the given `TargetIsa`.
@@ -176,5 +148,5 @@ pub trait Compiler {
function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>,
isa: &dyn isa::TargetIsa,
generate_debug_info: bool,
) -> Result<(Compilation, Relocations, AddressTransforms), CompileError>;
) -> Result<(Compilation, Relocations, ModuleAddressMap), CompileError>;
}