Add emit_unwind_info method to TargetIsa
This commit is contained in:
@@ -241,10 +241,9 @@ impl Context {
|
|||||||
&self,
|
&self,
|
||||||
isa: &dyn TargetIsa,
|
isa: &dyn TargetIsa,
|
||||||
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>> {
|
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>> {
|
||||||
let backend = isa.get_mach_backend();
|
|
||||||
let unwind_info_kind = isa.unwind_info_kind();
|
let unwind_info_kind = isa.unwind_info_kind();
|
||||||
let result = self.mach_compile_result.as_ref().unwrap();
|
let result = self.mach_compile_result.as_ref().unwrap();
|
||||||
backend.emit_unwind_info(result, unwind_info_kind)
|
isa.emit_unwind_info(result, unwind_info_kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Run the verifier on the function.
|
/// Run the verifier on the function.
|
||||||
|
|||||||
@@ -244,6 +244,16 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
|
|||||||
/// IntCC condition for Unsigned Addition Overflow (Carry).
|
/// IntCC condition for Unsigned Addition Overflow (Carry).
|
||||||
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC;
|
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC;
|
||||||
|
|
||||||
|
/// Creates unwind information for the function.
|
||||||
|
///
|
||||||
|
/// Returns `None` if there is no unwind information for the function.
|
||||||
|
#[cfg(feature = "unwind")]
|
||||||
|
fn emit_unwind_info(
|
||||||
|
&self,
|
||||||
|
result: &MachCompileResult,
|
||||||
|
kind: UnwindInfoKind,
|
||||||
|
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>>;
|
||||||
|
|
||||||
/// Creates a new System V Common Information Entry for the ISA.
|
/// Creates a new System V Common Information Entry for the ISA.
|
||||||
///
|
///
|
||||||
/// Returns `None` if the ISA does not support System V unwind information.
|
/// Returns `None` if the ISA does not support System V unwind information.
|
||||||
|
|||||||
@@ -68,6 +68,15 @@ impl TargetIsa for TargetIsaAdapter {
|
|||||||
self.backend.unsigned_add_overflow_condition()
|
self.backend.unsigned_add_overflow_condition()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unwind")]
|
||||||
|
fn emit_unwind_info(
|
||||||
|
&self,
|
||||||
|
result: &MachCompileResult,
|
||||||
|
kind: UnwindInfoKind,
|
||||||
|
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>> {
|
||||||
|
self.backend.emit_unwind_info(result, kind)
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "unwind")]
|
#[cfg(feature = "unwind")]
|
||||||
fn create_systemv_cie(&self) -> Option<gimli::write::CommonInformationEntry> {
|
fn create_systemv_cie(&self) -> Option<gimli::write::CommonInformationEntry> {
|
||||||
self.backend.create_systemv_cie()
|
self.backend.create_systemv_cie()
|
||||||
|
|||||||
Reference in New Issue
Block a user