Refactor SimpleJITTrapSink/FaerieTrapSink into NullTrapSink.
This publishes it for use outside of simpljie/faerie as well.
This commit is contained in:
@@ -123,3 +123,11 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
|
||||
self.traps.trap(ofs, srcloc, code);
|
||||
}
|
||||
}
|
||||
|
||||
/// A `TrapSink` implementation that does nothing, which is convenient when
|
||||
/// compiling code that does not rely on trapping semantics.
|
||||
pub struct NullTrapSink {}
|
||||
|
||||
impl TrapSink for NullTrapSink {
|
||||
fn trap(&mut self, _offset: CodeOffset, _srcloc: SourceLoc, _code: TrapCode) {}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
mod memorysink;
|
||||
mod relaxation;
|
||||
|
||||
pub use self::memorysink::{MemoryCodeSink, RelocSink, TrapSink};
|
||||
pub use self::memorysink::{MemoryCodeSink, RelocSink, TrapSink, NullTrapSink};
|
||||
pub use self::relaxation::relax_branches;
|
||||
pub use regalloc::RegDiversions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user