cranelift-module: expose trap information when defining functions
The current interface of `cranelift-module` requires consumers who want
to be informed about traps to discover that information through
`Module::Product`, which is backend-specific. Since it's advantageous
to manipulate this information in a backend-agnostic way, this patch
changes `Module::define_function{,_bytes}` to return information about
the traps contained in the function being defined.
This commit is contained in:
@@ -86,7 +86,7 @@ where
|
||||
ctx: &Context,
|
||||
namespace: &ModuleNamespace<Self>,
|
||||
code_size: u32,
|
||||
) -> ModuleResult<Self::CompiledFunction>;
|
||||
) -> ModuleResult<(Self::CompiledFunction, Option<&Vec<TrapSite>>)>;
|
||||
|
||||
/// Define a function, taking the function body from the given `bytes`.
|
||||
///
|
||||
@@ -98,7 +98,7 @@ where
|
||||
bytes: &[u8],
|
||||
namespace: &ModuleNamespace<Self>,
|
||||
traps: Vec<TrapSite>,
|
||||
) -> ModuleResult<Self::CompiledFunction>;
|
||||
) -> ModuleResult<(Self::CompiledFunction, Option<&Vec<TrapSite>>)>;
|
||||
|
||||
/// Define a zero-initialized data object of the given size.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user