pub struct PassManager { /* private fields */ }
Expand description
Structure that tracks all registered passes for the compiler.
Implementations§
Source§impl PassManager
impl PassManager
pub fn default_passes() -> PassResult<Self>
Source§impl PassManager
impl PassManager
Sourcepub fn register_pass<Pass>(&mut self) -> PassResult<()>
pub fn register_pass<Pass>(&mut self) -> PassResult<()>
Register a new Calyx pass and return an error if another pass with the same name has already been registered.
§Example
let pm = PassManager::default();
pm.register_pass::<WellFormed>()?;
Sourcepub fn register_diagnostic<Pass>(&mut self) -> PassResult<()>
pub fn register_diagnostic<Pass>(&mut self) -> PassResult<()>
Registers a diagnostic pass as a normal pass. If there is an error, this will report the first error gathered by the pass.
Sourcepub fn add_alias(&mut self, name: String, passes: Vec<String>) -> PassResult<()>
pub fn add_alias(&mut self, name: String, passes: Vec<String>) -> PassResult<()>
Adds a new alias for groups of passes. An alias is a list of strings that represent valid pass names OR an alias. The passes and aliases are executed in the order of specification.
Sourcepub fn specific_help(&self, pass: &str) -> Option<String>
pub fn specific_help(&self, pass: &str) -> Option<String>
Return the help string for a specific pass.
Sourcepub fn complete_help(&self) -> String
pub fn complete_help(&self) -> String
Return a string representation to show all available passes and aliases. Appropriate for help text.
Sourcepub fn execute_plan(
&self,
ctx: &mut Context,
incl: &[String],
excl: &[String],
insn: &[String],
dump_ir: bool,
) -> PassResult<()>
pub fn execute_plan( &self, ctx: &mut Context, incl: &[String], excl: &[String], insn: &[String], dump_ir: bool, ) -> PassResult<()>
Executes a given “plan” constructed using the incl and excl lists. ord is a relative ordering that should be enforced.
Trait Implementations§
Source§impl Default for PassManager
impl Default for PassManager
Source§fn default() -> PassManager
fn default() -> PassManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PassManager
impl !RefUnwindSafe for PassManager
impl !Send for PassManager
impl !Sync for PassManager
impl Unpin for PassManager
impl !UnwindSafe for PassManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more