Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer committed Sep 25, 2024
1 parent 1ad7abd commit 21eee05
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@ use crate::parser::BuiltinParse;
use crate::parser::Parser;
use core::fmt::Error;
use core::fmt::Write;
use crate::ir::Op;

pub trait Transform {
/// Transform the source code to the target code.
// TODO: This should take a memory object not a string.
fn transform(&self, src: &str, out: &mut dyn Write) -> Result<(), Error>;
fn transform(&self, from: &dyn Op, to: &mut dyn Write) -> Result<(), Error>;
}

struct MLIRToLLVMIRTranslation {}

impl Transform for MLIRToLLVMIRTranslation {
fn transform(&self, _src: &str, _out: &mut dyn Write) -> Result<(), Error> {
fn transform(&self, _from: &dyn Op, _to: &mut dyn Write) -> Result<(), Error> {
todo!()
}
}

pub struct Options {
pub struct OptOptions {
canonicalize: bool,
}

pub fn opt(src: &str, options: Options) -> String {
pub fn opt(src: &str, options: OptOptions) -> String {
let module = Parser::<BuiltinParse>::parse(src).unwrap();
if options.canonicalize {
println!("canonicalize");
Expand Down

0 comments on commit 21eee05

Please sign in to comment.