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:
@@ -59,7 +59,8 @@ impl FaerieTrapManifest {
|
||||
}
|
||||
|
||||
/// Put a `FaerieTrapSink` into manifest
|
||||
pub fn add_sink(&mut self, sink: FaerieTrapSink) {
|
||||
pub fn add_sink(&mut self, sink: FaerieTrapSink) -> &Vec<TrapSite> {
|
||||
self.sinks.push(sink);
|
||||
&self.sinks.last().unwrap().sites
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user