diff --git a/Project.toml b/Project.toml index 39d189f8..d2b38079 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/irbuilder.jl b/src/irbuilder.jl index e9eb9a97..1143e78a 100644 --- a/src/irbuilder.jl +++ b/src/irbuilder.jl @@ -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) """ diff --git a/test/instructions_tests.jl b/test/instructions_tests.jl index 51b6403c..4a9c81f1 100644 --- a/test/instructions_tests.jl +++ b/test/instructions_tests.jl @@ -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)