Skip to main content

rllvm/
lib.rs

1//! Whole-program LLVM bitcode generation in Rust.
2//!
3//! `rllvm` is a Rust port of [gllvm](https://github.com/SRI-CSL/gllvm) that provides
4//! compiler wrappers to transparently build whole-program LLVM bitcode files alongside
5//! normal compilation, and a tool to extract the embedded bitcode.
6//!
7//! # Overview
8//!
9//! The compiler wrappers ([`compiler_wrapper`]) intercept `clang`/`clang++` invocations,
10//! run the real compiler normally, then also generate LLVM bitcode and embed the bitcode
11//! file path into a special section of the output object file. The extraction tool
12//! (`rllvm-get-bc`) later reads those paths and links the bitcode together.
13//!
14//! # Configuration
15//!
16//! See [`config`] for TOML-based configuration via `~/.rllvm/config.toml`.
17
18// Keeps the public surface deliberate: a `pub` item that no `pub use`
19// re-exports is a mistake, not API.
20#![warn(unreachable_pub)]
21
22/// Command-line argument parsing for compiler flag classification.
23pub mod arg_parser;
24
25/// Incremental bitcode cache for skipping recompilation of unchanged files.
26pub mod cache;
27
28/// Diagnostic utilities for version checking, install hints, and colored output.
29pub mod diagnostics;
30
31/// TOML-based configuration and LLVM tool path resolution.
32pub mod config;
33
34/// Compiler wrapper traits and LLVM/Clang implementation.
35pub mod compiler_wrapper;
36
37/// Bitcode file analysis via `llvm-dis`.
38pub mod bitcode_info;
39
40/// Error types used throughout the crate.
41pub mod error;
42
43/// Bitcode merge strategies (full link, partial link, archive).
44pub mod merge;
45
46/// Link-time optimization modes and bitcode-path markers.
47pub mod lto;
48
49/// Utility functions for command execution, file manipulation, and LLVM tools.
50pub mod utils;
51
52/// Internal constants for argument patterns, section names, and LLVM version ranges.
53pub(crate) mod constants;