Expand description
The driver: command line parsing, the phase graph, job scheduling and the linker invocation.
Design: spec/04-driver-and-cli.md. Layer rank 12, see spec/18-package-layout.md.
This is the only crate that is allowed to know the process exists. It reads the command
line, touches the file system, spawns the linker and writes to the terminal, and it hands
everything below it a Session. The binary crate is a main that calls
run and nothing else, so that the whole driver is reachable from a test.
§Status
--help, --version and --print-config are real, which is the M0 exit criterion in
spec/17-milestones.md. The phase graph is real and -### prints it, and the scheduler
that will run it is real and tested.
Two phases run. -E reads the file, runs phase 4 over it and writes the result, to -o or
to standard output. --emit=tast carries on through phase 7, the parse and the checking,
and writes the typed tree. The flags those two read are real with them, which is -D, -U,
-I, -iquote, -isystem, -idirafter, -P, -std=, -fgnuc-version=, -ansi,
-ffreestanding, -pedantic and -Werror.
The phases after them still say they are not implemented.
This crate is tier 3 in spec/18-package-layout.md section 18.5: its Rust API is
explicitly unstable and will change without a major version bump.
Re-exports§
pub use crate::compile::Compiled;pub use crate::compile::compile;pub use crate::compile::compile_ir;pub use crate::phase::Input;pub use crate::phase::InputKind;pub use crate::phase::Job;pub use crate::phase::LinkJob;pub use crate::phase::Output;pub use crate::phase::Phase;pub use crate::phase::Plan;pub use crate::preprocess::OsFileSystem;pub use crate::preprocess::Preprocessed;pub use crate::preprocess::preprocess;pub use crate::schedule::Jobs;
Modules§
- compile
- Running the front end over one file, from the bytes on disk to the typed tree.
- phase
- The phase graph: what has to happen to each input file, in what order, and where the result goes.
- preprocess
- Running phase 4 and writing what came out, which is what
-Easks for. - schedule
- Running the jobs in a
Planacross threads, deterministically.
Structs§
- CliError
- Why a command line was rejected.
Enums§
- Action
- What the command line asked for.
Constants§
Functions§
- parse_
args - Parses a command line, without the program name.
- print_
config - Renders the resolved configuration.
- run
- Runs the driver and returns the process exit code.