Skip to main content

ModulePassManager

Struct ModulePassManager 

Source
pub struct ModulePassManager<'a> { /* private fields */ }
Expand description

A configured LLVM module pass manager using the new PassManager infrastructure.

Bundles all analysis managers, PassBuilder, StandardInstrumentations, and the ModulePassManager into a single object with correct lifetime management.

The lifetime 'a is tied to the borrowed inkwell::targets::TargetMachine, ensuring the target machine outlives the pass manager.

Implementations§

Source§

impl<'a> ModulePassManager<'a>

Source

pub fn with_opt_level( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>

Create a pass manager with a standard optimization pipeline.

Examples found in repository?
examples/all_pass_kinds.rs (line 583)
573fn main() -> Result<(), Box<dyn std::error::Error>> {
574    let module = build_demo_module();
575    module.verify()?;
576    assert_rich_ir(&module);
577
578    let module_ran = Arc::new(AtomicU32::new(0));
579    let function_ran = Arc::new(AtomicU32::new(0));
580    let cgscc_ran = Arc::new(AtomicU32::new(0));
581    let loop_ran = Arc::new(AtomicU32::new(0));
582
583    let mut module_pm = ModulePassManager::with_opt_level(None, OptLevel::O2, None)?;
584    module_pm.add_pass((ModuleAnalysisOnlyPass).into_pass());
585    module_pm.add_pass((ModuleStatsAnalysis).into_pass());
586    module_pm.add_pass(ModuleMutatePass {
587        ran: module_ran.clone(),
588    });
589    module_pm.add_cgscc_pass((CgsccAnalysisOnlyPass).into_pass());
590    module_pm.add_cgscc_pass(CgsccUsesAnalysisPass {
591        ran: cgscc_ran.clone(),
592        registered: Arc::new(AtomicBool::new(false)),
593    });
594    module_pm.run(&module)?;
595
596    let mut function_pm = FunctionPassManager::with_pipeline(
597        None,
598        "loop-simplify,loop-rotate,instcombine,simplifycfg",
599        None,
600    )?;
601    function_pm.add_pass((FunctionAnalysisOnlyPass).into_pass());
602    function_pm.add_pass((FunctionStatsAnalysis).into_pass());
603    function_pm.add_pass(FunctionMutatePass {
604        ran: function_ran.clone(),
605    });
606    function_pm.add_loop_pass((LoopAnalysisOnlyPass).into_pass());
607    function_pm.add_loop_pass(LoopUsesAnalysisPass {
608        ran: loop_ran.clone(),
609        registered: Arc::new(AtomicBool::new(false)),
610    });
611
612    for f in module.get_functions() {
613        if f.count_basic_blocks() == 0 {
614            continue;
615        }
616        function_pm.run(f)?;
617    }
618
619    module.verify()?;
620
621    assert_eq!(
622        get_pass_delta(&module),
623        DELTA_LOOP,
624        "final delta must reflect loop-pass mutation"
625    );
626    assert!(module_ran.load(Ordering::SeqCst) >= 1);
627    assert!(function_ran.load(Ordering::SeqCst) >= 3);
628    assert!(cgscc_ran.load(Ordering::SeqCst) >= 3);
629    assert!(loop_ran.load(Ordering::SeqCst) >= 1);
630
631    // Execute the final IR and assert deterministic output.
632    // driver(12, 5):
633    // callee_cond(12)=11, helper_loop(5)=10, delta=13 => adjusted=34 => returns 35.
634    let ee = module.create_jit_execution_engine(OptimizationLevel::None)?;
635    type DriverFn = unsafe extern "C" fn(i32, i32) -> i32;
636    // SAFETY: "driver" exists with signature i32(i32, i32) in this module.
637    let driver = unsafe { ee.get_function::<DriverFn>("driver") }?;
638    // SAFETY: calling with valid i32 arguments matches the JIT symbol signature.
639    let got = unsafe { driver.call(12, 5) };
640    assert_eq!(got, 35, "unexpected final JIT result");
641
642    println!(
643        "ok: delta={}, module_passes={}, function_passes={}, cgscc_passes={}, loop_passes={}, driver(12,5)={}",
644        get_pass_delta(&module),
645        module_ran.load(Ordering::SeqCst),
646        function_ran.load(Ordering::SeqCst),
647        cgscc_ran.load(Ordering::SeqCst),
648        loop_ran.load(Ordering::SeqCst),
649        got
650    );
651    Ok(())
652}
Source

pub fn with_pipeline( target_machine: Option<&'a TargetMachine>, pipeline: &str, options: Option<&Options>, ) -> Result<Self, Error>

Create a pass manager from a textual pipeline description.

The format matches opt -passes=... syntax, e.g.:

  • "instcombine,dce,sroa"
  • "default<O2>"
  • "module(function(instcombine,sroa))"
Source

pub fn with_lto( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>

Create a pass manager with the full-LTO default pipeline.

Create a pass manager with the full-LTO pre-link pipeline.

Create a pass manager with the ThinLTO pre-link pipeline.

Source

pub fn new( target_machine: Option<&'a TargetMachine>, options: Option<&Options>, ) -> Result<Self, Error>

Create an empty module pass manager with no built-in passes.

Use add_pass() to add custom passes.

Examples found in repository?
examples/dead_code_elimination.rs (line 298)
290fn main() -> Result<(), Box<dyn std::error::Error>> {
291    let module = build_module_with_dead_code();
292    module.verify()?;
293
294    let removed = Arc::new(AtomicU32::new(0));
295
296    // Phase 1: Report initial stats + CGSCC analysis (before DCE)
297    {
298        let mut pm = ModulePassManager::new(None, None)?;
299        pm.add_pass(DCEStatsPass {
300            label: "Before DCE",
301        });
302        pm.add_cgscc_pass(BasicBlockReportPass {
303            registered: Arc::new(AtomicBool::new(false)),
304        });
305        pm.run(&module)?;
306    }
307
308    // Phase 2: Run DCE on each function
309    {
310        let mut fpm = FunctionPassManager::new(None, None)?;
311        fpm.add_pass(SimpleDCEPass {
312            removed: removed.clone(),
313        });
314        for func in module.get_functions() {
315            if func.count_basic_blocks() == 0 {
316                continue;
317            }
318            fpm.run(func)?;
319        }
320    }
321
322    module.verify()?;
323
324    // Phase 3: Report final stats (after DCE)
325    {
326        let mut pm = ModulePassManager::new(None, None)?;
327        pm.add_pass(DCEStatsPass { label: "After DCE" });
328        pm.run(&module)?;
329    }
330
331    let total_removed = removed.load(Ordering::SeqCst);
332    println!("\nRemoved {} dead instructions", total_removed);
333    assert!(
334        total_removed >= 5,
335        "Expected to remove at least 5 dead instructions, got {}",
336        total_removed
337    );
338
339    println!("ok");
340    Ok(())
341}
Source

pub fn add_pass<P>(&mut self, pass: P)
where P: LlvmModulePass + 'static,

Add a custom module pass to this pass manager.

The pass is moved into the pass manager and kept alive until the pass manager is dropped. The pass is appended after any existing passes in the pipeline.

Examples found in repository?
examples/dead_code_elimination.rs (lines 299-301)
290fn main() -> Result<(), Box<dyn std::error::Error>> {
291    let module = build_module_with_dead_code();
292    module.verify()?;
293
294    let removed = Arc::new(AtomicU32::new(0));
295
296    // Phase 1: Report initial stats + CGSCC analysis (before DCE)
297    {
298        let mut pm = ModulePassManager::new(None, None)?;
299        pm.add_pass(DCEStatsPass {
300            label: "Before DCE",
301        });
302        pm.add_cgscc_pass(BasicBlockReportPass {
303            registered: Arc::new(AtomicBool::new(false)),
304        });
305        pm.run(&module)?;
306    }
307
308    // Phase 2: Run DCE on each function
309    {
310        let mut fpm = FunctionPassManager::new(None, None)?;
311        fpm.add_pass(SimpleDCEPass {
312            removed: removed.clone(),
313        });
314        for func in module.get_functions() {
315            if func.count_basic_blocks() == 0 {
316                continue;
317            }
318            fpm.run(func)?;
319        }
320    }
321
322    module.verify()?;
323
324    // Phase 3: Report final stats (after DCE)
325    {
326        let mut pm = ModulePassManager::new(None, None)?;
327        pm.add_pass(DCEStatsPass { label: "After DCE" });
328        pm.run(&module)?;
329    }
330
331    let total_removed = removed.load(Ordering::SeqCst);
332    println!("\nRemoved {} dead instructions", total_removed);
333    assert!(
334        total_removed >= 5,
335        "Expected to remove at least 5 dead instructions, got {}",
336        total_removed
337    );
338
339    println!("ok");
340    Ok(())
341}
More examples
Hide additional examples
examples/all_pass_kinds.rs (line 584)
573fn main() -> Result<(), Box<dyn std::error::Error>> {
574    let module = build_demo_module();
575    module.verify()?;
576    assert_rich_ir(&module);
577
578    let module_ran = Arc::new(AtomicU32::new(0));
579    let function_ran = Arc::new(AtomicU32::new(0));
580    let cgscc_ran = Arc::new(AtomicU32::new(0));
581    let loop_ran = Arc::new(AtomicU32::new(0));
582
583    let mut module_pm = ModulePassManager::with_opt_level(None, OptLevel::O2, None)?;
584    module_pm.add_pass((ModuleAnalysisOnlyPass).into_pass());
585    module_pm.add_pass((ModuleStatsAnalysis).into_pass());
586    module_pm.add_pass(ModuleMutatePass {
587        ran: module_ran.clone(),
588    });
589    module_pm.add_cgscc_pass((CgsccAnalysisOnlyPass).into_pass());
590    module_pm.add_cgscc_pass(CgsccUsesAnalysisPass {
591        ran: cgscc_ran.clone(),
592        registered: Arc::new(AtomicBool::new(false)),
593    });
594    module_pm.run(&module)?;
595
596    let mut function_pm = FunctionPassManager::with_pipeline(
597        None,
598        "loop-simplify,loop-rotate,instcombine,simplifycfg",
599        None,
600    )?;
601    function_pm.add_pass((FunctionAnalysisOnlyPass).into_pass());
602    function_pm.add_pass((FunctionStatsAnalysis).into_pass());
603    function_pm.add_pass(FunctionMutatePass {
604        ran: function_ran.clone(),
605    });
606    function_pm.add_loop_pass((LoopAnalysisOnlyPass).into_pass());
607    function_pm.add_loop_pass(LoopUsesAnalysisPass {
608        ran: loop_ran.clone(),
609        registered: Arc::new(AtomicBool::new(false)),
610    });
611
612    for f in module.get_functions() {
613        if f.count_basic_blocks() == 0 {
614            continue;
615        }
616        function_pm.run(f)?;
617    }
618
619    module.verify()?;
620
621    assert_eq!(
622        get_pass_delta(&module),
623        DELTA_LOOP,
624        "final delta must reflect loop-pass mutation"
625    );
626    assert!(module_ran.load(Ordering::SeqCst) >= 1);
627    assert!(function_ran.load(Ordering::SeqCst) >= 3);
628    assert!(cgscc_ran.load(Ordering::SeqCst) >= 3);
629    assert!(loop_ran.load(Ordering::SeqCst) >= 1);
630
631    // Execute the final IR and assert deterministic output.
632    // driver(12, 5):
633    // callee_cond(12)=11, helper_loop(5)=10, delta=13 => adjusted=34 => returns 35.
634    let ee = module.create_jit_execution_engine(OptimizationLevel::None)?;
635    type DriverFn = unsafe extern "C" fn(i32, i32) -> i32;
636    // SAFETY: "driver" exists with signature i32(i32, i32) in this module.
637    let driver = unsafe { ee.get_function::<DriverFn>("driver") }?;
638    // SAFETY: calling with valid i32 arguments matches the JIT symbol signature.
639    let got = unsafe { driver.call(12, 5) };
640    assert_eq!(got, 35, "unexpected final JIT result");
641
642    println!(
643        "ok: delta={}, module_passes={}, function_passes={}, cgscc_passes={}, loop_passes={}, driver(12,5)={}",
644        get_pass_delta(&module),
645        module_ran.load(Ordering::SeqCst),
646        function_ran.load(Ordering::SeqCst),
647        cgscc_ran.load(Ordering::SeqCst),
648        loop_ran.load(Ordering::SeqCst),
649        got
650    );
651    Ok(())
652}
Source

pub fn add_cgscc_pass<P>(&mut self, pass: P)
where P: LlvmCgsccPass + 'static,

Add a custom CGSCC pass to this pass manager.

The pass is adapted into the module pipeline and invoked for each function in each SCC.

Examples found in repository?
examples/dead_code_elimination.rs (lines 302-304)
290fn main() -> Result<(), Box<dyn std::error::Error>> {
291    let module = build_module_with_dead_code();
292    module.verify()?;
293
294    let removed = Arc::new(AtomicU32::new(0));
295
296    // Phase 1: Report initial stats + CGSCC analysis (before DCE)
297    {
298        let mut pm = ModulePassManager::new(None, None)?;
299        pm.add_pass(DCEStatsPass {
300            label: "Before DCE",
301        });
302        pm.add_cgscc_pass(BasicBlockReportPass {
303            registered: Arc::new(AtomicBool::new(false)),
304        });
305        pm.run(&module)?;
306    }
307
308    // Phase 2: Run DCE on each function
309    {
310        let mut fpm = FunctionPassManager::new(None, None)?;
311        fpm.add_pass(SimpleDCEPass {
312            removed: removed.clone(),
313        });
314        for func in module.get_functions() {
315            if func.count_basic_blocks() == 0 {
316                continue;
317            }
318            fpm.run(func)?;
319        }
320    }
321
322    module.verify()?;
323
324    // Phase 3: Report final stats (after DCE)
325    {
326        let mut pm = ModulePassManager::new(None, None)?;
327        pm.add_pass(DCEStatsPass { label: "After DCE" });
328        pm.run(&module)?;
329    }
330
331    let total_removed = removed.load(Ordering::SeqCst);
332    println!("\nRemoved {} dead instructions", total_removed);
333    assert!(
334        total_removed >= 5,
335        "Expected to remove at least 5 dead instructions, got {}",
336        total_removed
337    );
338
339    println!("ok");
340    Ok(())
341}
More examples
Hide additional examples
examples/all_pass_kinds.rs (line 589)
573fn main() -> Result<(), Box<dyn std::error::Error>> {
574    let module = build_demo_module();
575    module.verify()?;
576    assert_rich_ir(&module);
577
578    let module_ran = Arc::new(AtomicU32::new(0));
579    let function_ran = Arc::new(AtomicU32::new(0));
580    let cgscc_ran = Arc::new(AtomicU32::new(0));
581    let loop_ran = Arc::new(AtomicU32::new(0));
582
583    let mut module_pm = ModulePassManager::with_opt_level(None, OptLevel::O2, None)?;
584    module_pm.add_pass((ModuleAnalysisOnlyPass).into_pass());
585    module_pm.add_pass((ModuleStatsAnalysis).into_pass());
586    module_pm.add_pass(ModuleMutatePass {
587        ran: module_ran.clone(),
588    });
589    module_pm.add_cgscc_pass((CgsccAnalysisOnlyPass).into_pass());
590    module_pm.add_cgscc_pass(CgsccUsesAnalysisPass {
591        ran: cgscc_ran.clone(),
592        registered: Arc::new(AtomicBool::new(false)),
593    });
594    module_pm.run(&module)?;
595
596    let mut function_pm = FunctionPassManager::with_pipeline(
597        None,
598        "loop-simplify,loop-rotate,instcombine,simplifycfg",
599        None,
600    )?;
601    function_pm.add_pass((FunctionAnalysisOnlyPass).into_pass());
602    function_pm.add_pass((FunctionStatsAnalysis).into_pass());
603    function_pm.add_pass(FunctionMutatePass {
604        ran: function_ran.clone(),
605    });
606    function_pm.add_loop_pass((LoopAnalysisOnlyPass).into_pass());
607    function_pm.add_loop_pass(LoopUsesAnalysisPass {
608        ran: loop_ran.clone(),
609        registered: Arc::new(AtomicBool::new(false)),
610    });
611
612    for f in module.get_functions() {
613        if f.count_basic_blocks() == 0 {
614            continue;
615        }
616        function_pm.run(f)?;
617    }
618
619    module.verify()?;
620
621    assert_eq!(
622        get_pass_delta(&module),
623        DELTA_LOOP,
624        "final delta must reflect loop-pass mutation"
625    );
626    assert!(module_ran.load(Ordering::SeqCst) >= 1);
627    assert!(function_ran.load(Ordering::SeqCst) >= 3);
628    assert!(cgscc_ran.load(Ordering::SeqCst) >= 3);
629    assert!(loop_ran.load(Ordering::SeqCst) >= 1);
630
631    // Execute the final IR and assert deterministic output.
632    // driver(12, 5):
633    // callee_cond(12)=11, helper_loop(5)=10, delta=13 => adjusted=34 => returns 35.
634    let ee = module.create_jit_execution_engine(OptimizationLevel::None)?;
635    type DriverFn = unsafe extern "C" fn(i32, i32) -> i32;
636    // SAFETY: "driver" exists with signature i32(i32, i32) in this module.
637    let driver = unsafe { ee.get_function::<DriverFn>("driver") }?;
638    // SAFETY: calling with valid i32 arguments matches the JIT symbol signature.
639    let got = unsafe { driver.call(12, 5) };
640    assert_eq!(got, 35, "unexpected final JIT result");
641
642    println!(
643        "ok: delta={}, module_passes={}, function_passes={}, cgscc_passes={}, loop_passes={}, driver(12,5)={}",
644        get_pass_delta(&module),
645        module_ran.load(Ordering::SeqCst),
646        function_ran.load(Ordering::SeqCst),
647        cgscc_ran.load(Ordering::SeqCst),
648        loop_ran.load(Ordering::SeqCst),
649        got
650    );
651    Ok(())
652}
Source

pub fn add_function_pass_via_cgscc<P>(&mut self, pass: P)
where P: LlvmFunctionPass + 'static,

Add a custom function pass adapted through the CGSCC level.

The pass is wrapped with Module → CGSCC → Function adaptors, so it runs on each function within the CGSCC traversal order.

Source

pub fn add_loop_pass_via_cgscc<P>(&mut self, pass: P)
where P: LlvmLoopPass + 'static,

Add a custom loop pass adapted through the CGSCC and function levels.

The pass is wrapped with Module → CGSCC → Function → Loop adaptors.

Source

pub fn run(&mut self, module: &Module<'_>) -> Result<(), Error>

Run the optimization passes on the given module.

Examples found in repository?
examples/dead_code_elimination.rs (line 305)
290fn main() -> Result<(), Box<dyn std::error::Error>> {
291    let module = build_module_with_dead_code();
292    module.verify()?;
293
294    let removed = Arc::new(AtomicU32::new(0));
295
296    // Phase 1: Report initial stats + CGSCC analysis (before DCE)
297    {
298        let mut pm = ModulePassManager::new(None, None)?;
299        pm.add_pass(DCEStatsPass {
300            label: "Before DCE",
301        });
302        pm.add_cgscc_pass(BasicBlockReportPass {
303            registered: Arc::new(AtomicBool::new(false)),
304        });
305        pm.run(&module)?;
306    }
307
308    // Phase 2: Run DCE on each function
309    {
310        let mut fpm = FunctionPassManager::new(None, None)?;
311        fpm.add_pass(SimpleDCEPass {
312            removed: removed.clone(),
313        });
314        for func in module.get_functions() {
315            if func.count_basic_blocks() == 0 {
316                continue;
317            }
318            fpm.run(func)?;
319        }
320    }
321
322    module.verify()?;
323
324    // Phase 3: Report final stats (after DCE)
325    {
326        let mut pm = ModulePassManager::new(None, None)?;
327        pm.add_pass(DCEStatsPass { label: "After DCE" });
328        pm.run(&module)?;
329    }
330
331    let total_removed = removed.load(Ordering::SeqCst);
332    println!("\nRemoved {} dead instructions", total_removed);
333    assert!(
334        total_removed >= 5,
335        "Expected to remove at least 5 dead instructions, got {}",
336        total_removed
337    );
338
339    println!("ok");
340    Ok(())
341}
More examples
Hide additional examples
examples/all_pass_kinds.rs (line 594)
573fn main() -> Result<(), Box<dyn std::error::Error>> {
574    let module = build_demo_module();
575    module.verify()?;
576    assert_rich_ir(&module);
577
578    let module_ran = Arc::new(AtomicU32::new(0));
579    let function_ran = Arc::new(AtomicU32::new(0));
580    let cgscc_ran = Arc::new(AtomicU32::new(0));
581    let loop_ran = Arc::new(AtomicU32::new(0));
582
583    let mut module_pm = ModulePassManager::with_opt_level(None, OptLevel::O2, None)?;
584    module_pm.add_pass((ModuleAnalysisOnlyPass).into_pass());
585    module_pm.add_pass((ModuleStatsAnalysis).into_pass());
586    module_pm.add_pass(ModuleMutatePass {
587        ran: module_ran.clone(),
588    });
589    module_pm.add_cgscc_pass((CgsccAnalysisOnlyPass).into_pass());
590    module_pm.add_cgscc_pass(CgsccUsesAnalysisPass {
591        ran: cgscc_ran.clone(),
592        registered: Arc::new(AtomicBool::new(false)),
593    });
594    module_pm.run(&module)?;
595
596    let mut function_pm = FunctionPassManager::with_pipeline(
597        None,
598        "loop-simplify,loop-rotate,instcombine,simplifycfg",
599        None,
600    )?;
601    function_pm.add_pass((FunctionAnalysisOnlyPass).into_pass());
602    function_pm.add_pass((FunctionStatsAnalysis).into_pass());
603    function_pm.add_pass(FunctionMutatePass {
604        ran: function_ran.clone(),
605    });
606    function_pm.add_loop_pass((LoopAnalysisOnlyPass).into_pass());
607    function_pm.add_loop_pass(LoopUsesAnalysisPass {
608        ran: loop_ran.clone(),
609        registered: Arc::new(AtomicBool::new(false)),
610    });
611
612    for f in module.get_functions() {
613        if f.count_basic_blocks() == 0 {
614            continue;
615        }
616        function_pm.run(f)?;
617    }
618
619    module.verify()?;
620
621    assert_eq!(
622        get_pass_delta(&module),
623        DELTA_LOOP,
624        "final delta must reflect loop-pass mutation"
625    );
626    assert!(module_ran.load(Ordering::SeqCst) >= 1);
627    assert!(function_ran.load(Ordering::SeqCst) >= 3);
628    assert!(cgscc_ran.load(Ordering::SeqCst) >= 3);
629    assert!(loop_ran.load(Ordering::SeqCst) >= 1);
630
631    // Execute the final IR and assert deterministic output.
632    // driver(12, 5):
633    // callee_cond(12)=11, helper_loop(5)=10, delta=13 => adjusted=34 => returns 35.
634    let ee = module.create_jit_execution_engine(OptimizationLevel::None)?;
635    type DriverFn = unsafe extern "C" fn(i32, i32) -> i32;
636    // SAFETY: "driver" exists with signature i32(i32, i32) in this module.
637    let driver = unsafe { ee.get_function::<DriverFn>("driver") }?;
638    // SAFETY: calling with valid i32 arguments matches the JIT symbol signature.
639    let got = unsafe { driver.call(12, 5) };
640    assert_eq!(got, 35, "unexpected final JIT result");
641
642    println!(
643        "ok: delta={}, module_passes={}, function_passes={}, cgscc_passes={}, loop_passes={}, driver(12,5)={}",
644        get_pass_delta(&module),
645        module_ran.load(Ordering::SeqCst),
646        function_ran.load(Ordering::SeqCst),
647        cgscc_ran.load(Ordering::SeqCst),
648        loop_ran.load(Ordering::SeqCst),
649        got
650    );
651    Ok(())
652}

Trait Implementations§

Source§

impl<'a> Debug for ModulePassManager<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Drop for ModulePassManager<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a> Send for ModulePassManager<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ModulePassManager<'a>

§

impl<'a> !Sync for ModulePassManager<'a>

§

impl<'a> !UnwindSafe for ModulePassManager<'a>

§

impl<'a> Freeze for ModulePassManager<'a>

§

impl<'a> Unpin for ModulePassManager<'a>

§

impl<'a> UnsafeUnpin for ModulePassManager<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.