pub enum LlvmError {
Parse(String),
Analyze(usize),
UnsupportedSignature(String),
Codegen(String),
}Expand description
Top-level error type for the LLVM AOT backend. Construction sites fall into four buckets:
LlvmError::Parse— the parser rejected the source. Only produced throughfrom_sourcepaths; the direct-IR entry points cannot hit this arm.LlvmError::Analyze— analyzer rejected the source. Reports the diagnostic count instead of the full message bundle to keep the error variant cheap to clone; hosts that want the full diagnostic stream should driverelon_analyzer::analyzedirectly.LlvmError::UnsupportedSignature— the IR module’s entry signature is outside the Phase A bootstrap envelope (legacy(I64...) -> I64). Buffer-protocol entries fall here today.LlvmError::Codegen— the LLVM emitter / JIT engine refused the input (unsupported op, IR builder failure, JIT setup failure). The carriedStringis the inkwell builder’s own message; we don’t try to map it to a typed enum at this stage.
Variants§
Parse(String)
Parser failure. Only reachable through from_source-style
entry points (Phase B+); direct-IR paths skip this stage.
Analyze(usize)
Analyzer rejected the source with count errors. Phase A
returns the count so the relon facade can wrap it without
having to allocate a diagnostic vector.
UnsupportedSignature(String)
The IR module’s entry function does not match the Phase A
envelope (legacy (I64...) -> I64). The carried string names
the rejected param / return type so the host can decide
whether to retry through the cranelift backend.
Codegen(String)
LLVM emitter / JIT engine surfaced an error during compile. Wraps the inkwell builder message rather than a typed enum — Phase A keeps the surface narrow so the bootstrap test can fail loudly without locking us into a permanent error taxonomy.
Trait Implementations§
Source§impl Error for LlvmError
impl Error for LlvmError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for LlvmError
impl RefUnwindSafe for LlvmError
impl Send for LlvmError
impl Sync for LlvmError
impl Unpin for LlvmError
impl UnsafeUnpin for LlvmError
impl UnwindSafe for LlvmError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more