[][src]Struct llvm_ir::module::Module

pub struct Module {
    pub name: String,
    pub source_file_name: String,
    pub data_layout: String,
    pub target_triple: Option<String>,
    pub functions: Vec<Function>,
    pub global_vars: Vec<GlobalVariable>,
    pub global_aliases: Vec<GlobalAlias>,
    pub inline_assembly: String,
    pub types: Types,
}

Fields

name: String

The name of the module

source_file_name: Stringdata_layout: Stringtarget_triple: Option<String>functions: Vec<Function>

Functions which are defined (not just declared) in this Module. See LLVM 10 docs on Functions

global_vars: Vec<GlobalVariable>global_aliases: Vec<GlobalAlias>inline_assembly: Stringtypes: Types

Holds a reference to all of the Types used in the Module, and facilitates lookups so you can get a TypeRef to the Type you want.

Implementations

impl Module[src]

pub fn type_of<T: Typed + ?Sized>(&self, t: &T) -> TypeRef[src]

Get the type of anything that is Typed.

pub fn get_func_by_name(&self, name: &str) -> Option<&Function>[src]

Get the Function having the given Name (if any). Note that Functions are named with Strings and not Names.

pub fn from_bc_path(path: impl AsRef<Path>) -> Result<Self, String>[src]

Parse the LLVM bitcode (.bc) file at the given path to create a Module

Trait Implementations

impl Clone for Module[src]

Auto Trait Implementations

impl RefUnwindSafe for Module

impl Send for Module

impl Sync for Module

impl Unpin for Module

impl UnwindSafe for Module

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.