@@ -56,9 +56,9 @@ for T in [:Int1, :Int8, :Int16, :Int32, :Int64, :Int128]
5656 end
5757end
5858
59- IntType (bits:: Integer ) = IntegerType (API. LLVMIntType (Cuint ( bits) ))
59+ IntType (bits:: Integer ) = IntegerType (API. LLVMIntType (bits))
6060IntType (bits:: Integer , ctx:: Context ) =
61- IntegerType (API. LLVMIntTypeInContext (ref (ctx), Cuint ( bits) ))
61+ IntegerType (API. LLVMIntTypeInContext (ref (ctx), bits))
6262
6363width (inttyp:: IntegerType ) = API. LLVMGetIntTypeWidth (ref (inttyp))
6464
@@ -100,7 +100,7 @@ identify(::Type{LLVMType}, ::Val{API.LLVMFunctionTypeKind}) = FunctionType
100100
101101FunctionType (rettyp:: LLVMType , params:: Vector{T} = LLVMType[], vararg:: Core.Bool = false ) where {T<: LLVMType } =
102102 FunctionType (API. LLVMFunctionType (ref (rettyp), ref .(params),
103- Cuint ( length (params) ), convert (Bool, vararg)))
103+ length (params), convert (Bool, vararg)))
104104
105105isvararg (ft:: FunctionType ) =
106106 convert (Core. Bool, API. LLVMIsFunctionVarArg (ref (ft)))
137137identify (:: Type{LLVMType} , :: Val{API.LLVMPointerTypeKind} ) = PointerType
138138
139139function PointerType (eltyp:: LLVMType , addrspace= 0 )
140- return PointerType (API. LLVMPointerType (ref (eltyp),
141- Cuint (addrspace)))
140+ return PointerType (API. LLVMPointerType (ref (eltyp), addrspace))
142141end
143142
144143addrspace (ptrtyp:: PointerType ) =
151150identify (:: Type{LLVMType} , :: Val{API.LLVMArrayTypeKind} ) = ArrayType
152151
153152function ArrayType (eltyp:: LLVMType , count)
154- return ArrayType (API. LLVMArrayType (ref (eltyp), Cuint ( count) ))
153+ return ArrayType (API. LLVMArrayType (ref (eltyp), count))
155154end
156155
157156Base. length (arrtyp:: ArrayType ) = API. LLVMGetArrayLength (ref (arrtyp))
165164identify (:: Type{LLVMType} , :: Val{API.LLVMVectorTypeKind} ) = VectorType
166165
167166function VectorType (eltyp:: LLVMType , count)
168- return VectorType (API. LLVMVectorType (ref (eltyp), Cuint ( count) ))
167+ return VectorType (API. LLVMVectorType (ref (eltyp), count))
169168end
170169
171170Base. size (vectyp:: VectorType ) = API. LLVMGetVectorSize (ref (vectyp))
@@ -185,12 +184,12 @@ function StructType(name::String, ctx::Context=GlobalContext())
185184end
186185
187186StructType (elems:: Vector{T} , packed:: Core.Bool = false ) where {T<: LLVMType } =
188- StructType (API. LLVMStructType (ref .(elems), Cuint ( length (elems) ),
187+ StructType (API. LLVMStructType (ref .(elems), length (elems),
189188 convert (Bool, packed)))
190189
191190StructType (elems:: Vector{T} , ctx:: Context , packed:: Core.Bool = false ) where {T<: LLVMType } =
192191 StructType (API. LLVMStructTypeInContext (ref (ctx), ref .(elems),
193- Cuint ( length (elems) ), convert (Bool, packed)))
192+ length (elems), convert (Bool, packed)))
194193
195194name (structtyp:: StructType ) =
196195 unsafe_string (API. LLVMGetStructName (ref (structtyp)))
@@ -201,7 +200,7 @@ isopaque(structtyp::StructType) =
201200
202201elements! (structtyp:: StructType , elems:: Vector{T} , packed:: Core.Bool = false ) where {T<: LLVMType } =
203202 API. LLVMStructSetBody (ref (structtyp), ref .(elems),
204- Cuint ( length (elems) ), convert (Bool, packed))
203+ length (elems), convert (Bool, packed))
205204
206205Base. isempty (@nospecialize (T:: StructType )) =
207206 isempty (elements (T)) || all (isempty, elements (T))
@@ -219,7 +218,7 @@ elements(typ::StructType) = StructTypeElementSet(typ)
219218Base. eltype (:: StructTypeElementSet ) = LLVMType
220219
221220Base. getindex (iter:: StructTypeElementSet , i) =
222- LLVMType (API. LLVMStructGetTypeAtIndex (ref (iter. typ), Cuint ( i- 1 ) ))
221+ LLVMType (API. LLVMStructGetTypeAtIndex (ref (iter. typ), i- 1 ))
223222
224223function Base. iterate (iter:: StructTypeElementSet , i= 1 )
225224 i >= length (iter) + 1 ? nothing : (iter[i], i+ 1 )
0 commit comments