1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Error types surfaced by the LLVM AOT pipeline.
//!
//! Modelled after `relon_codegen_cranelift::CraneliftError` so the
//! relon facade can wrap both backends through the same
//! `BackendError` shape — switching backends should not change which
//! variants the host needs to match on.
use Error;
/// Top-level error type for the LLVM AOT backend. Construction sites
/// fall into four buckets:
///
/// * [`LlvmError::Parse`] — the parser rejected the source. Only
/// produced through `from_source` paths; 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 drive `relon_analyzer::analyze`
/// directly.
/// * [`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 carried `String` is the inkwell builder's own
/// message; we don't try to map it to a typed enum at this stage.