Skip to main content

Facts

Struct Facts 

Source
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

Source

pub fn nothing() -> Self

Nothing known about anything, which is what a pass holding one function has.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn declared(&self, name: Symbol) -> Purity

What the user declared about this function, on its own.

Source

pub fn inferred(&self, name: Symbol) -> Purity

What analysis worked out about this function, on its own.

Source

pub fn purity_of(&self, callee: Callee) -> Purity

What this call can do.

The match has no wildcard arm and adding a kind of callee should keep it that way.

Trait Implementations§

Source§

impl Clone for Facts

Source§

fn clone(&self) -> Facts

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Facts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Facts

Source§

fn default() -> Facts

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Facts

§

impl RefUnwindSafe for Facts

§

impl Send for Facts

§

impl Sync for Facts

§

impl Unpin for Facts

§

impl UnsafeUnpin for Facts

§

impl UnwindSafe for Facts

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.