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 4, 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, the include search path and the headers the compiler itself ships 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.

Modules§

runtime
The headers the compiler ships, and the directory they appear to live in.

Structs§

Deps
What the -M family asks for, which is a make rule saying what a source file was built from.
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__.
Lto
What the -flto family asked for, which is a whole optimization this compiler does not do yet.
MemoryFileSystem
A file system held in memory, for tests and for embedding the compiler.
Options
Everything a compilation was asked to do.
Patchable
How much room at the top of every function is reserved for somebody to write over later, which -fpatchable-function-entry= asks for.
PrefixMap
A list of old=new rewrites to apply to a path before it is written into the output, which is what the -f*-prefix-map= family asks for.
PrefixMaps
The three answers to the question the -f*-prefix-map= family asks, which is one question asked about three kinds of output.
Preinclude
A file -imacros or -include named, read before the source file.
Profile
What the profile reading half of the -fprofile family asked for.
SearchPath
The directories a header is looked for in, in order.
Session
One compilation.
Wrapping
What overflows rather than being undefined, from -fwrapv and its relatives.

Enums§

Compress
How the debug sections are compressed, which is what -gz asks.
Contract
How far a multiply and an addition may be fused into one rounding, from -ffp-contract=.
Control
Which control flow transfers are checked, which is what -fcf-protection= asks.
EmitKind
What the compiler should produce.
Hook
Where the call -pg puts at the top of every function goes, which -mfentry chooses.
IncludeForm
Which spelling an #include used.
LtoJobs
How many processes the link time work is spread over, which is what -flto= takes.
OptLevel
An optimisation level.
Padding
Whether padding participates in the init plane, from -fsafety-init=.
Partition
How the program is cut up before the link time work is spread over it, from -flto-partition=.
Pic
Which of the two position independent questions the output is answering.
Promise
Whether the restrict contract is checked, from -fsafety-restrict.
Protector
Which functions get a stack protector, which is what the -fstack-protector family asks.
Safety
How much of the memory safety monitor is on, from -fsafety=.
SaveTemps
Whether -save-temps was given and where it puts the files it keeps.
Std
Which C the source is written in.
Subobject
Whether an access has to stay inside the member it names, from -fsafety-subobject.
Visibility
How far a name reaches outside a shared library when nothing in the source said.

Traits§

FileSystem
Where the compiler reads source from.

Functions§

path_key
The key that every spelling of one path shares, as far as text can say.