Return error for register mapping failure.

This commit removes a panic when a register mapping fails and instead returns
an error from creating the unwind information.
This commit is contained in:
Peter Huene
2020-04-15 14:02:26 -07:00
parent 5dba941180
commit 2fb7e9f3c2
3 changed files with 34 additions and 27 deletions

View File

@@ -30,6 +30,11 @@ pub enum CodegenError {
/// is exceeded, compilation fails.
#[error("Code for function is too large")]
CodeTooLarge,
/// A failure to map Cranelift register representation to a DWARF register representation.
#[cfg(feature = "unwind")]
#[error("Register mapping error")]
RegisterMappingError(crate::isa::unwind::systemv::RegisterMappingError),
}
/// A convenient alias for a `Result` that uses `CodegenError` as the error type.