diff --git a/melior/src/dialect/llvm/type.rs b/melior/src/dialect/llvm/type.rs index ecf4de5a77..0caefdd796 100644 --- a/melior/src/dialect/llvm/type.rs +++ b/melior/src/dialect/llvm/type.rs @@ -5,8 +5,8 @@ use crate::{ ir::{Type, TypeLike}, }; use mlir_sys::{ - mlirLLVMArrayTypeGet, mlirLLVMFunctionTypeGet, mlirLLVMPointerTypeGet, - mlirLLVMStructTypeLiteralGet, mlirLLVMVoidTypeGet, + mlirLLVMArrayTypeGet, mlirLLVMFunctionTypeGet, mlirLLVMStructTypeLiteralGet, + mlirLLVMVoidTypeGet, }; // TODO Check if the `llvm` dialect is loaded on use of those functions. @@ -37,11 +37,6 @@ pub fn opaque_pointer(context: &Context) -> Type { Type::parse(context, "!llvm.ptr").unwrap() } -/// Creates an LLVM pointer type. -pub fn pointer(r#type: Type, address_space: u32) -> Type { - unsafe { Type::from_raw(mlirLLVMPointerTypeGet(r#type.to_raw(), address_space)) } -} - /// Creates an LLVM struct type. pub fn r#struct<'c>(context: &'c Context, fields: &[Type<'c>], packed: bool) -> Type<'c> { unsafe { @@ -83,28 +78,6 @@ mod tests { ); } - #[test] - fn pointer() { - let context = create_context(); - let i32 = IntegerType::new(&context, 32).into(); - - assert_eq!( - super::pointer(i32, 0), - Type::parse(&context, "!llvm.ptr<i32>").unwrap() - ); - } - - #[test] - fn pointer_with_address_space() { - let context = create_context(); - let i32 = IntegerType::new(&context, 32).into(); - - assert_eq!( - super::pointer(i32, 4), - Type::parse(&context, "!llvm.ptr<i32, 4>").unwrap() - ); - } - #[test] fn void() { let context = create_context();