Skip to content

Commit

Permalink
Revert "TEST"
Browse files Browse the repository at this point in the history
This reverts commit 69cc1a4.
  • Loading branch information
raviqqe committed Oct 18, 2023
1 parent 69cc1a4 commit cb33aab
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions melior/src/ir/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use mlir_sys::{
mlirModuleCreateEmpty, mlirModuleCreateParse, mlirModuleDestroy, mlirModuleFromOperation,
mlirModuleGetBody, mlirModuleGetContext, mlirModuleGetOperation, MlirModule,
};
use std::{ffi::CString, marker::PhantomData, mem::forget};
use std::{ffi::CString, marker::PhantomData};

/// A module.
#[derive(Debug)]
Expand All @@ -24,16 +24,10 @@ impl<'c> Module<'c> {

/// Parses a module.
pub fn parse(context: &Context, source: &str) -> Option<Self> {
let string = CString::new(source).unwrap();
let source = StringRef::from_c_str(&string);
let source = CString::new(source).unwrap();
let source = StringRef::from_c_str(&source);

let module = unsafe {
Self::from_option_raw(mlirModuleCreateParse(context.to_raw(), source.to_raw()))
};

forget(string);

module
unsafe { Self::from_option_raw(mlirModuleCreateParse(context.to_raw(), source.to_raw())) }
}

/// Converts a module into an operation.
Expand Down

0 comments on commit cb33aab

Please sign in to comment.