Skip to content

Commit 3d8d210

Browse files
authored
Don't ICE on non-void return types. (#512)
1 parent f28fcdc commit 3d8d210

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/irgen.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ end
343343
# https://reviews.llvm.org/D79744
344344
function lower_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function)
345345
ft = function_type(f)
346-
@compiler_assert return_type(ft) == LLVM.VoidType() job
347346
@timeit_debug to "lower byval" begin
348347

349348
# find the byval parameters

src/metal.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ end
356356
# Metal doesn't support passing valuse, so we need to convert those to references instead
357357
function pass_by_reference!(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function)
358358
ft = function_type(f)
359-
@compiler_assert return_type(ft) == LLVM.VoidType() job
360359

361360
# generate the new function type & definition
362361
args = classify_arguments(job, ft)

src/spirv.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ end
220220
# wrap byval pointers in a single-value struct
221221
function wrap_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function)
222222
ft = function_type(f)::LLVM.FunctionType
223-
@compiler_assert return_type(ft) == LLVM.VoidType() job
224223

225224
# find the byval parameters
226225
byval = BitVector(undef, length(parameters(ft)))
@@ -253,7 +252,7 @@ function wrap_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.F
253252
end
254253
push!(new_types, typ)
255254
end
256-
new_ft = LLVM.FunctionType(LLVM.VoidType(), new_types)
255+
new_ft = LLVM.FunctionType(return_type(ft), new_types)
257256
new_f = LLVM.Function(mod, "", new_ft)
258257
linkage!(new_f, linkage(f))
259258
for (arg, new_arg) in zip(parameters(f), parameters(new_f))

0 commit comments

Comments
 (0)