[−][src]Struct llvm_ir::module::Module
Fields
name: String
The name of the module
source_file_name: String
data_layout: String
target_triple: Option<String>
functions: Vec<Function>
Functions which are defined (not just declared) in this Module
.
See LLVM 9 docs on Functions
global_vars: Vec<GlobalVariable>
global_aliases: Vec<GlobalAlias>
named_struct_types: HashMap<String, Option<Arc<RwLock<Type>>>>
Structure types can be "identified", meaning named. This map holds the named structure types in this Module
.
See LLVM 9 docs on Structure Type.
A None
value indicates an opaque type; see LLVM 9 docs on Opaque Structure Types.
Note that this map is from struct name to Type::StructType
variant, not to Type::NamedStructType
variant (which would be redundant).
Arc<RwLock<_>>
is used rather than Rc<RefCell<_>>
so that Module
can remain Sync
.
This is important because it allows multiple threads to simultaneously access a
single (immutable) Module
.
inline_assembly: String
Implementations
impl Module
[src]
pub fn get_func_by_name(&self, name: &str) -> Option<&Function>
[src]
Get the Function
having the given Name
(if any).
Note that Function
s are named with String
s and not Name
s.
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,