Skip to content

Commit c21f11a

Browse files
authoredSep 11, 2024··
Restore nameless IRBuilder insert method. (#483)
1 parent f3a2836 commit c21f11a

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
 

‎Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LLVM"
22
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
3-
version = "9.1.1"
3+
version = "9.1.2"
44

55
[deps]
66
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"

‎src/irbuilder.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ position!(builder::IRBuilder) = API.LLVMClearInsertionPosition(builder)
8787
Insert an instruction into the current basic block at the current position, optionally
8888
giving it a name.
8989
"""
90-
Base.insert!(builder::IRBuilder, inst::Instruction, name::String) =
90+
Base.insert!(builder::IRBuilder, inst::Instruction, name::String="") =
9191
API.LLVMInsertIntoBuilderWithName(builder, inst, name)
9292

9393
"""

‎test/instructions_tests.jl

+6-3
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,14 @@ end
558558
entry = BasicBlock(fun, "entry")
559559
position!(builder, entry)
560560
# add and substract 42
561+
561562
a = fadd!(builder, parameters(fun)[1], LLVM.ConstantFP(Float32(42.)), "a")
562-
# fast_math!(a; all=true)
563563
b = fsub!(builder, a, LLVM.ConstantFP(Float32(42.)), "b")
564-
# fast_math!(b; all=true)
565-
ret!(builder, b)
564+
retinst = ret!(builder, b)
565+
566+
# support for removing/insertion
567+
remove!(retinst)
568+
insert!(builder, retinst)
566569
end
567570
verify(mod)
568571

2 commit comments

Comments
 (2)

maleadt commented on Sep 11, 2024

@maleadt
CollaboratorAuthor

JuliaRegistrator commented on Sep 11, 2024

@JuliaRegistrator

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.