Skip to main content

Crate rucc_session

Crate rucc_session 

Source
Expand description

The Session: the options, the interner and the diagnostic sink that every stage of a single compilation is handed.

Design: spec/03-architecture.md and spec/04-driver-and-cli.md. Layer rank 3, see spec/18-package-layout.md.

Everything below the driver reaches the outside world through this type and not through std::fs, std::env or println!. That is the whole reason the compiler can be used as a library and tested without spawning a process, and it is enforced by the layer rule rather than by discipline.

§Status

Options, optimisation levels, emit kinds, diagnostic counting, the source map every span is resolved against, the file system the compiler reads through and the include search path are real. The parallel job model is still a placeholder.

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.

Structs§

Dir
One directory on the search path.
Dumps
What the -d family asks to be dumped alongside, or instead of, the preprocessed output.
Found
A header that was found.
GnucVersion
The GCC release the compiler claims to be, as __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__.
MemoryFileSystem
A file system held in memory, for tests and for embedding the compiler.
Options
Everything a compilation was asked to do.
SearchPath
The directories a header is looked for in, in order.
Session
One compilation.

Enums§

EmitKind
What the compiler should produce.
IncludeForm
Which spelling an #include used.
OptLevel
An optimisation level.
Std
Which C the source is written in.

Traits§

FileSystem
Where the compiler reads source from.