Skip to content

Commit

Permalink
Add llvmtype_ conversion for UInt
Browse files Browse the repository at this point in the history
  • Loading branch information
brenhinkeller committed Jul 23, 2022
1 parent 5abbb4d commit bb3e43b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StaticTools"
uuid = "86c06d3c-3f03-46de-9781-57580aa96d0a"
authors = ["C. Brenhin Keller and contributors"]
version = "0.5.4"
version = "0.5.5"

[deps]
ManualMemory = "d125e4d3-2237-4719-b19c-fa641b8a4667"
Expand Down
2 changes: 2 additions & 0 deletions src/llvminterop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ function llvmtype_external(t)
(t === :Int16 || t === :UInt16) && return :i16
(t === :Int8 || t === :UInt8) && return :i8
(t === :Bool) && return :i1
t === :UInt && return UInt===UInt64 ? :i64 : :i32
t === :Int && return Int===Int64 ? :i64 : :i32
t === :Float64 && return :double
t === :Float32 && return :float
Expand Down Expand Up @@ -541,6 +542,7 @@ function llvmtype_internal(t)
(t === :Int16 || t === :UInt16) && return :i16
(t === :Int8 || t === :UInt8) && return :i8
(t === :Bool) && return :i1
t === :UInt && return UInt===UInt64 ? :i64 : :i32
t === :Int && return Int===Int64 ? :i64 : :i32
t === :Float64 && return :double
t === :Float32 && return :float
Expand Down
1 change: 1 addition & 0 deletions test/testllvminterop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@
@test StaticTools.llvmtype_internal(:(Ptr{Ptr{Ptr{Ptr{Ptr{UInt8}}}}})) == :("i8*****")
@test StaticTools.llvmtype_internal(:(Ptr{Float32})) == :("float*")
@test StaticTools.llvmtype_internal(:(Ptr{Float16})) == :("half*")
@test StaticTools.llvmtype_internal(:UInt) == StaticTools.llvmtype_external(:UInt) == ((Int==Int64) ? :i64 : :i32)

2 comments on commit bb3e43b

@brenhinkeller
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Add llvmtype_ conversion for UInt

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/64800

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.5 -m "<description of version>" bb3e43b71be67cd8bac64dd55e6946f64595ee70
git push origin v0.5.5

Please sign in to comment.