pub struct ConstantFoldingPass {
pub folds_performed: u32,
}Expand description
Constant folding pass – evaluate constant expressions at compile time.
Fields§
§folds_performed: u32Implementations§
Source§impl ConstantFoldingPass
impl ConstantFoldingPass
pub fn new() -> Self
pub fn run(&mut self, decls: &mut [LcnfFunDecl])
Sourcepub fn try_fold_nat_op(&self, op: &str, lhs: u64, rhs: u64) -> Option<u64>
pub fn try_fold_nat_op(&self, op: &str, lhs: u64, rhs: u64) -> Option<u64>
Try to fold a nat binary operation.
Trait Implementations§
Source§impl Debug for ConstantFoldingPass
impl Debug for ConstantFoldingPass
Source§impl Default for ConstantFoldingPass
impl Default for ConstantFoldingPass
Source§impl OptPass for ConstantFoldingPass
impl OptPass for ConstantFoldingPass
Source§fn run_pass(&mut self, decls: &mut [LcnfFunDecl]) -> usize
fn run_pass(&mut self, decls: &mut [LcnfFunDecl]) -> usize
Run the pass on a set of declarations, returning the number of changes made.
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Whether this pass is enabled.
Source§fn dependencies(&self) -> Vec<&str>
fn dependencies(&self) -> Vec<&str>
Dependencies: names of passes that must run before this one.
Auto Trait Implementations§
impl Freeze for ConstantFoldingPass
impl RefUnwindSafe for ConstantFoldingPass
impl Send for ConstantFoldingPass
impl Sync for ConstantFoldingPass
impl Unpin for ConstantFoldingPass
impl UnsafeUnpin for ConstantFoldingPass
impl UnwindSafe for ConstantFoldingPass
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