pub struct Module { /* private fields */ }
Expand description
A wrapper around a LLVMModuleRef
for a specific context
Implementations§
Source§impl Module
impl Module
Sourcepub fn add_function<S>(&self, name: S, ty: Type) -> Value
pub fn add_function<S>(&self, name: S, ty: Type) -> Value
Add a function to the module
Sourcepub fn add_global<S>(&self, name: S, ty: Type) -> Value
pub fn add_global<S>(&self, name: S, ty: Type) -> Value
Add a global to the module
Sourcepub fn get_function<S>(&self, name: S) -> Value
pub fn get_function<S>(&self, name: S) -> Value
Get the function with the given name
Sourcepub fn get_global<S>(&self, name: S) -> Value
pub fn get_global<S>(&self, name: S) -> Value
Get the global with the given name
Sourcepub fn set_triple<S>(&self, triple: S)
pub fn set_triple<S>(&self, triple: S)
Sets the target triple for this module
Sourcepub fn set_data_layout(&self, data: &TargetData)
pub fn set_data_layout(&self, data: &TargetData)
Sets the data layout for this module
Sourcepub fn write_llvm_ir<P>(&self, path: P)
pub fn write_llvm_ir<P>(&self, path: P)
Write module IR to a file
Sourcepub fn write_bitcode<P>(&self, path: P)
pub fn write_bitcode<P>(&self, path: P)
Write module bitcode to a file
Sourcepub fn inner(&self) -> LLVMModuleRef
pub fn inner(&self) -> LLVMModuleRef
Returns the internal module reference
Sourcepub unsafe fn into_inner(self) -> LLVMModuleRef
pub unsafe fn into_inner(self) -> LLVMModuleRef
Destroys the wrapper, returning the internal module reference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl !Send for Module
impl !Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more