@@ -290,7 +290,7 @@ function add_address_spaces!(@nospecialize(job::CompilerJob), mod::LLVM.Module,
290290 fn = LLVM. name (f)
291291 @assert isempty (uses (f))
292292 replace_metadata_uses! (f, new_f)
293- unsafe_delete! (mod, f)
293+ erase! ( f)
294294 LLVM. name! (new_f, fn)
295295
296296 # clean-up after this pass (which runs after optimization)
@@ -384,7 +384,7 @@ function pass_by_reference!(@nospecialize(job::CompilerJob), mod::LLVM.Module, f
384384 # NOTE: if we ever have legitimate uses of the old function, create a shim instead
385385 fn = LLVM. name (f)
386386 @assert isempty (uses (f))
387- unsafe_delete! (mod, f)
387+ erase! ( f)
388388 LLVM. name! (new_f, fn)
389389
390390 return new_f
@@ -432,7 +432,7 @@ function argument_type_name(typ)
432432 elseif typ isa LLVM. IntegerType && width (typ) == 32
433433 " uint"
434434 elseif typ isa LLVM. VectorType
435- argument_type_name (eltype (typ)) * string (Int (size (typ)))
435+ argument_type_name (eltype (typ)) * string (Int (length (typ)))
436436 else
437437 error (" Cannot encode unknown type `$typ `" )
438438 end
@@ -551,7 +551,7 @@ function add_input_arguments!(@nospecialize(job::CompilerJob), mod::LLVM.Module,
551551
552552 replace_uses! (val, new_val)
553553 @assert isempty (uses (val))
554- unsafe_delete! (LLVM . parent (val), val)
554+ erase! ( val)
555555 elseif val isa LLVM. ConstantExpr && opcode (val) == LLVM. API. LLVMBitCast
556556 # XXX : why isn't this caught by the value materializer above?
557557 target = operands (val)[1 ]
@@ -575,7 +575,7 @@ function add_input_arguments!(@nospecialize(job::CompilerJob), mod::LLVM.Module,
575575 for (f, new_f) in workmap
576576 rewrite_uses! (f, new_f)
577577 @assert isempty (uses (f))
578- unsafe_delete! (mod, f)
578+ erase! ( f)
579579 end
580580
581581 # replace uses of the intrinsics with references to the input arguments
@@ -591,10 +591,10 @@ function add_input_arguments!(@nospecialize(job::CompilerJob), mod::LLVM.Module,
591591 end
592592
593593 @assert isempty (uses (val))
594- unsafe_delete! (LLVM . parent (val), val)
594+ erase! ( val)
595595 end
596596 @assert isempty (uses (intr))
597- unsafe_delete! (mod, intr)
597+ erase! ( intr)
598598 end
599599
600600 return
@@ -820,7 +820,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
820820 " llvm.assume"
821821 ])
822822 if intr in unsupported_intrinsics
823- unsafe_delete! (bb, call)
823+ erase! ( call)
824824 changed = true
825825 end
826826
@@ -854,7 +854,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
854854 elseif typ == LLVM. DoubleType ()
855855 " f64"
856856 elseif typ isa LLVM. VectorType
857- " v$(size (typ))$(type_suffix (eltype (typ))) "
857+ " v$(length (typ))$(type_suffix (eltype (typ))) "
858858 else
859859 error (" Unsupported intrinsic type: $typ " )
860860 end
@@ -877,7 +877,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
877877
878878 new_value = call! (builder, call_ft, new_intr, arguments (call))
879879 replace_uses! (call, new_value)
880- unsafe_delete! (bb, call)
880+ erase! ( call)
881881 changed = true
882882 end
883883 end
@@ -915,7 +915,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
915915
916916 new_value = bitcast! (builder, new_value, typ)
917917 replace_uses! (call, new_value)
918- unsafe_delete! (bb, call)
918+ erase! ( call)
919919 changed = true
920920 end
921921 end
@@ -1032,7 +1032,7 @@ function lower_llvm_intrinsics!(@nospecialize(job::CompilerJob), fun::LLVM.Funct
10321032
10331033 new_value = call! (builder, call_ft, new_intr, arguments (call))
10341034 replace_uses! (call, new_value)
1035- unsafe_delete! (bb, call)
1035+ erase! ( call)
10361036 changed = true
10371037 end
10381038 end
@@ -1134,7 +1134,7 @@ function replace_unreachable!(@nospecialize(job::CompilerJob), f::LLVM.Function)
11341134 br! (builder, return_block)
11351135
11361136 # move the return
1137- delete! (exit_block, ret)
1137+ remove! ( ret)
11381138 position! (builder, return_block)
11391139 insert! (builder, ret)
11401140 end
@@ -1159,13 +1159,13 @@ function replace_unreachable!(@nospecialize(job::CompilerJob), f::LLVM.Function)
11591159 # remove preceding traps to avoid reconstructing unreachable control flow
11601160 prev = previnst (unreachable)
11611161 if isa (prev, LLVM. CallInst) && name (called_operand (prev)) == " llvm.trap"
1162- unsafe_delete! (bb, prev)
1162+ erase! ( prev)
11631163 end
11641164
11651165 # replace the unreachable with a branch to the return block
11661166 position! (builder, unreachable)
11671167 br! (builder, return_block)
1168- unsafe_delete! (bb, unreachable)
1168+ erase! ( unreachable)
11691169
11701170 # patch up any phi nodes in the return block
11711171 for inst in instructions (return_block)
0 commit comments