Record an FDE for the given function. Windows-flavored unwind info is silently ignored: `.pdata`/`.xdata` emission lives on a separate code path. The CIE is created lazily on the first System V FDE so that an unwind builder shared across many objects does not pay for an empty CIE when the target produces no System V info at all.
(
&mut self,
isa: &dyn TargetIsa,
func_symbol: SymbolId,
info: UnwindInfo,
)
| 50 | /// objects does not pay for an empty CIE when the target produces no |
| 51 | /// System V info at all. |
| 52 | pub(crate) fn add_function( |
| 53 | &mut self, |
| 54 | isa: &dyn TargetIsa, |
| 55 | func_symbol: SymbolId, |
| 56 | info: UnwindInfo, |
| 57 | ) { |
| 58 | let UnwindInfo::SystemV(sysv) = info else { |
| 59 | return; |
| 60 | }; |
| 61 | let cie_id = match self.cie_id { |
| 62 | Some(id) => id, |
| 63 | None => { |
| 64 | let Some(cie) = isa.create_systemv_cie() else { |
| 65 | return; |
| 66 | }; |
| 67 | let id = self.frame_table.add_cie(cie); |
| 68 | self.cie_id = Some(id); |
| 69 | id |
| 70 | } |
| 71 | }; |
| 72 | let symbol_index = self.symbols.len(); |
| 73 | self.symbols.push(func_symbol); |
| 74 | let address = Address::Symbol { |
| 75 | symbol: symbol_index, |
| 76 | addend: 0, |
| 77 | }; |
| 78 | self.frame_table.add_fde(cie_id, sysv.to_fde(address)); |
| 79 | } |
| 80 | |
| 81 | /// Serialize all collected FDEs into an `.eh_frame` section on `object`. |
| 82 | /// |
no test coverage detected