Skip to content

Commit

Permalink
Restore nameless IRBuilder insert method. (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Sep 11, 2024
1 parent f3a2836 commit c21f11a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LLVM"
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
version = "9.1.1"
version = "9.1.2"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
2 changes: 1 addition & 1 deletion src/irbuilder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ position!(builder::IRBuilder) = API.LLVMClearInsertionPosition(builder)
Insert an instruction into the current basic block at the current position, optionally
giving it a name.
"""
Base.insert!(builder::IRBuilder, inst::Instruction, name::String) =
Base.insert!(builder::IRBuilder, inst::Instruction, name::String="") =
API.LLVMInsertIntoBuilderWithName(builder, inst, name)

"""
Expand Down
9 changes: 6 additions & 3 deletions test/instructions_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,14 @@ end
entry = BasicBlock(fun, "entry")
position!(builder, entry)
# add and substract 42

a = fadd!(builder, parameters(fun)[1], LLVM.ConstantFP(Float32(42.)), "a")
# fast_math!(a; all=true)
b = fsub!(builder, a, LLVM.ConstantFP(Float32(42.)), "b")
# fast_math!(b; all=true)
ret!(builder, b)
retinst = ret!(builder, b)

# support for removing/insertion
remove!(retinst)
insert!(builder, retinst)
end
verify(mod)

Expand Down

2 comments on commit c21f11a

@maleadt
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
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/114987

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v9.1.2 -m "<description of version>" c21f11a5cb73bbaf332a8b09b9809b0b8f424e75
git push origin v9.1.2

Please sign in to comment.