Struct Context

Source
pub struct Context { /* private fields */ }

Implementations§

Source§

impl Context

Source

pub fn background() -> Self

Source

pub fn with_builder(parent: &Context, builder: IRBuilder) -> Self

Source

pub fn with_module_slot_map( parent: &Context, t: SlotMap<DefaultKey, Module>, ) -> Self

Source

pub fn apply_mut_module(&self, key: DefaultKey, apply: impl Fn(&mut Module))

Source

pub fn get_module_slot_map(&self) -> Arc<RwLock<SlotMap<DefaultKey, Module>>>

Source

pub fn apply_module(&self, key: DefaultKey, apply: impl FnMut(&Module))

Source

pub fn register_module(&self, module: Module) -> DefaultKey

Source

pub fn with_type(parent: &Context, name: String, ty: Type) -> Self

Source

pub fn get_builder(&self) -> Arc<IRBuilder>

Source

pub fn get_current_function(&self) -> FunctionValue

Source

pub fn get_current_function_type(&self) -> &Type

Source

pub fn with_scope(parent: &Context) -> Self

Source

pub fn with_type_table(parent: &Context, t: HashMap<Type, LLVMType>) -> Self

Source

pub fn create_llvm_context() -> Self

Source

pub fn with_function(parent: &Context, f: FunctionValue) -> Self

Source

pub fn with_flag(parent: &Context, key: impl Into<String>, flag: bool) -> Self

Source

pub fn get_llvm_module(&self) -> Rc<RwLock<LLVMModule>>

Source

pub fn with_llvm_module(parent: &Context, m: LLVMModule) -> Self

Source

pub fn get_llvm_context(&self) -> Rc<Mutex<LLVMContext>>

Source

pub fn with_local(parent: &Context, local: Vec<String>) -> Self

Source

pub fn get_type_binding_functions(&self, name: &str) -> Vec<Function>

Source

pub fn with_capture(parent: &Context) -> Self

Source

pub fn set_flag(&self, key: impl Into<String>, flag: bool)

Source

pub fn get_flag(&self, key: impl Into<String>) -> Option<bool>

Source

pub fn with_value( parent: &Context, key: ContextKey, value: ContextValue, ) -> Self

Source

pub fn get(&self, key: ContextKey) -> Option<&ContextValue>

Source

pub fn get_scope(&self) -> Scope

Source

pub fn set_symbol(&self, name: String, v: LLVMValue)

Source

pub fn get_symbol(&self, name: impl AsRef<str>) -> Option<LLVMValue>

Source

pub fn get_type(&self, t: &Type) -> Option<LLVMType>

Source

pub fn register_type(&self, ty: &Type, llvm_ty: &LLVMType)

Source

pub fn get_alias_type(&self, name: impl AsRef<str>) -> Option<Type>

Source

pub fn set_alias_type(&self, name: String, t0: Type)

Source

pub fn get_symbol_type(&self, name: impl AsRef<str>) -> Option<Type>

Source

pub fn try_add_local(&self, name: String)

Source

pub fn add_capture(&self, name: String, ty: Type)

Source

pub fn is_local_variable(&self, name: impl AsRef<str>) -> bool

Source

pub fn get_captures(&self) -> Option<Vec<(String, Type)>>

Source

pub fn get_function(&self, name: impl AsRef<str>) -> Option<Function>

Source

pub fn set_symbol_type(&self, name: String, t0: Type)

Source

pub fn get_type_alias(&self, name: impl AsRef<str>) -> Option<TypeAlias>

Source

pub fn with_loop_block( parent: &Context, name: String, block: LLVMBasicBlockRef, ) -> Self

Source

pub fn get_loop_block(&self, name: &str) -> Option<LLVMBasicBlockRef>

Source

pub fn with_default_expr(parent: &Context) -> Self

Source

pub fn set_default_expr(&self, name: String, expr: Box<ExprNode>)

Source

pub fn get_default_expr(&self, name: &str) -> Option<Box<ExprNode>>

Trait Implementations§

Source§

impl Clone for Context

Source§

fn clone(&self) -> Context

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Context

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Context

§

impl !RefUnwindSafe for Context

§

impl !Send for Context

§

impl !Sync for Context

§

impl Unpin for Context

§

impl !UnwindSafe for Context

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.