From 0fb658b7a224a59110916ed8a8304aa5aec26b31 Mon Sep 17 00:00:00 2001 From: jumerckx Date: Mon, 18 Mar 2024 19:44:51 +0100 Subject: [PATCH 1/2] allow to manually specify type for integerattr (e.g. to create indexattribute) --- src/IR/Attribute.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IR/Attribute.jl b/src/IR/Attribute.jl index 0a5bda06..c4396b1b 100644 --- a/src/IR/Attribute.jl +++ b/src/IR/Attribute.jl @@ -141,7 +141,7 @@ isinteger(attr::Attribute) = API.mlirAttributeIsAInteger(attr) Creates an integer attribute of the given type with the given integer value. """ -Attribute(i::T) where {T<:Integer} = Attribute(API.mlirIntegerAttrGet(Type(T), Int64(i))) +Attribute(i::T, t=Type(T)) where {T<:Integer} = Attribute(API.mlirIntegerAttrGet(t, Int64(i))) """ Int64(attr) From 1c6c2bdccafd88c1566632759b6157507da3d8f0 Mon Sep 17 00:00:00 2001 From: jumerckx <31353884+jumerckx@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:39:30 +0100 Subject: [PATCH 2/2] Update src/IR/Attribute.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sergio Sánchez Ramírez <15837247+mofeing@users.noreply.github.com> --- src/IR/Attribute.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IR/Attribute.jl b/src/IR/Attribute.jl index c4396b1b..8d5b674c 100644 --- a/src/IR/Attribute.jl +++ b/src/IR/Attribute.jl @@ -141,7 +141,7 @@ isinteger(attr::Attribute) = API.mlirAttributeIsAInteger(attr) Creates an integer attribute of the given type with the given integer value. """ -Attribute(i::T, t=Type(T)) where {T<:Integer} = Attribute(API.mlirIntegerAttrGet(t, Int64(i))) +Attribute(i::T, type=Type(T)) where {T<:Integer} = Attribute(API.mlirIntegerAttrGet(type, Int64(i))) """ Int64(attr)