mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-25 04:52:32 +00:00
use inkwell's FunctionIterator
This commit is contained in:
parent
b907f01f1f
commit
031866799a
3 changed files with 2 additions and 32 deletions
|
@ -91,34 +91,6 @@ macro_rules! debug_info_init {
|
|||
}};
|
||||
}
|
||||
|
||||
/// Iterate over all functions in an llvm module
|
||||
pub struct FunctionIterator<'ctx> {
|
||||
next: Option<FunctionValue<'ctx>>,
|
||||
}
|
||||
|
||||
impl<'ctx> FunctionIterator<'ctx> {
|
||||
pub fn from_module(module: &inkwell::module::Module<'ctx>) -> Self {
|
||||
Self {
|
||||
next: module.get_first_function(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> Iterator for FunctionIterator<'ctx> {
|
||||
type Item = FunctionValue<'ctx>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
match self.next {
|
||||
Some(function) => {
|
||||
self.next = function.get_next_function();
|
||||
|
||||
Some(function)
|
||||
}
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Scope<'a, 'ctx> {
|
||||
symbols: ImMap<Symbol, (Layout<'a>, BasicValueEnum<'ctx>)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue