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
//! BPF / eBPF Backend
//!
//! A compact backend for the Berkeley Packet Filter virtual machine (BPF64).
//! Supports the full eBPF instruction set as used by the Linux kernel, with
//! 64-bit and 32-bit ALU operations, branching, atomic operations, and
//! endian conversion.
//!
//! ## Sub-modules
//!
//! - `bpf_instr_info` — BPF instruction set definitions (opcodes, mnemonics).
//! - `bpf_isel` — BPF instruction selection from LLVM IR.
//! - `bpf_asm_printer` — BPF assembly text format printer.
//! - `bpf_target_machine` — BPF target machine description.
//! - `bpf_mc_encoder` — BPF instruction encoding (8-byte fixed-width).
//!
//! ## Architecture
//!
//! ```text
//! LLVM IR → BpfISel → BpfMCEncoder → BPF bytecode (8-byte insns)
//! BpfAsmPrinter → BPF assembly text
//! ```
//!
//! BPF instruction format (64 bits):
//! `opcode:8 | dst_reg:4 | src_reg:4 | offset:16 | immediate:32`
//!
//! Clean-room implementation from the Linux kernel BPF documentation
//! (Documentation/bpf/instruction-set.rst), the eBPF ISA specification,
//! and IETF draft-thaler-bpf-isa. No LLVM C++ source consulted.
// Re-export key types for convenience.
pub use BpfAsmPrinter;
pub use ;
pub use BpfISel;
pub use BpfMCEncoder;
pub use BpfTargetMachine;