| 1 |
//! Dummy version of dwarf emission that does nothing when the compile-time |
| 2 |
//! feature is disabled. |
| 3 |
|
| 4 |
use crate::core::Local; |
| 5 |
use crate::core::binary::{EncodeOptions, Encoder, Names, RecOrType}; |
| 6 |
use crate::token::Span; |
| 7 |
|
| 8 |
pub struct Dwarf<'a> { |
| 9 |
uninhabited: &'a std::convert::Infallible, |
| 10 |
} |
| 11 |
|
| 12 |
impl<'a> Dwarf<'a> { |
| 13 |
pub fn new( |
| 14 |
_func_imports: u32, |
| 15 |
_opts: &EncodeOptions<'a>, |
| 16 |
_names: &Names<'a>, |
| 17 |
_types: &'a [RecOrType<'a>], |
| 18 |
) -> Option<Dwarf<'a>> { |
| 19 |
None |
| 20 |
} |
| 21 |
|
| 22 |
pub fn start_func(&mut self, _span: Span, _ty: u32, _locals: &[Local<'_>]) { |
| 23 |
match *self.uninhabited {} |
| 24 |
} |
| 25 |
|
| 26 |
pub fn instr(&mut self, _offset: usize, _span: Span) { |
| 27 |
match *self.uninhabited {} |
| 28 |
} |
| 29 |
|
| 30 |
pub fn end_func(&mut self, _: usize, _: usize) { |
| 31 |
match *self.uninhabited {} |
| 32 |
} |
| 33 |
|
| 34 |
pub fn set_code_section_size(&mut self, _size: usize) { |
| 35 |
match *self.uninhabited {} |
| 36 |
} |
| 37 |
|
| 38 |
pub fn emit(&mut self, _dst: &mut Encoder<'_>) { |
| 39 |
match *self.uninhabited {} |
| 40 |
} |
| 41 |
} |