pub struct Facts { /* private fields */ }Expand description
What is known about the functions a call could reach.
Built once from the module, because the attributes belong to the callee and there is one callee
and many call sites. A caller with no module has Facts::nothing, which answers
Purity::Opaque to everything and is correct.
Implementations§
Source§impl Facts
impl Facts
Sourcepub fn nothing() -> Self
pub fn nothing() -> Self
Nothing known about anything, which is what a pass holding one function has.
Sourcepub fn of_module(module: &Module, names: &Interner) -> Self
pub fn of_module(module: &Module, names: &Interner) -> Self
What the module says about each of its functions.
The interner is here for the library table, which is written in text because that is what the C standard names. Nothing after this call needs it.
Sourcepub fn without_the_library(&mut self)
pub fn without_the_library(&mut self)
Turns off the whole library table, which is -fno-builtin and -ffreestanding.
A freestanding program has no C library for the name to be the name of, and a program that
means its own thing by strlen is the reason the flag exists.
Sourcepub fn not_the_library_name(&mut self, name: Symbol)
pub fn not_the_library_name(&mut self, name: Symbol)
Takes one name away from the table, which is -fno-builtin-<name>.
What a build that means its own memcpy and the library’s everything else writes, which is
what the kernel does for a handful of names.
Sourcepub fn record_inferred(&mut self, name: Symbol, purity: Purity)
pub fn record_inferred(&mut self, name: Symbol, purity: Purity)
Records what document 34’s analysis worked out about a function.
A separate field from the declaration on purpose. The two are combined where they are read and are never written over each other, so that a later build can check one against the other and report the function whose attribute was a lie.
Sourcepub fn declared(&self, name: Symbol) -> Purity
pub fn declared(&self, name: Symbol) -> Purity
What the user declared about this function, on its own.