Skip to content

Commit 8dba144

Browse files
aviateskmaleadt
andauthored
Adapt to upstream changes to return_types (#312)
* adapt to upstream changes to `Base.return_types` Especially this commits adds the update corresponding to <JuliaLang/julia#44515>. * Fix test. * more update with backports Co-authored-by: Tim Besard <[email protected]>
1 parent 9afda49 commit 8dba144

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/jlgen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ end
226226

227227
if isdefined(Base.Experimental, Symbol("@overlay"))
228228
using Core.Compiler: OverlayMethodTable
229-
if VERSION >= v"1.9.0-DEV.120"
229+
if v"1.8-beta2" <= VERSION < v"1.9-" || VERSION >= v"1.9.0-DEV.120"
230230
Core.Compiler.method_table(interp::GPUInterpreter) =
231231
OverlayMethodTable(interp.world, interp.method_table)
232232
else

src/validation.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ function check_method(@nospecialize(job::CompilerJob))
1616
cache = ci_cache(job)
1717
mt = method_table(job)
1818
interp = GPUInterpreter(cache, mt, job.source.world)
19-
rt = Base.return_types(job.source.f, job.source.tt, interp)[1]
19+
@static if v"1.8-beta2" <= VERSION < v"1.9-" || VERSION v"1.9.0-DEV.190"
20+
# https://github.com/JuliaLang/julia/pull/44515
21+
rt = Base.return_types(job.source.f, job.source.tt; interp)[1]
22+
else
23+
rt = Base.return_types(job.source.f, job.source.tt, interp)[1]
24+
end
2025
if rt != Nothing
2126
throw(KernelError(job, "kernel returns a value of type `$rt`",
2227
"""Make sure your kernel function ends in `return`, `return nothing` or `nothing`.

test/native.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ end
339339

340340
# Test ABI removal
341341
ir = sprint(io->native_code_llvm(io, call_real, Tuple{ComplexF64}))
342-
if VERSION < v"1.8-"
342+
if VERSION < v"1.8-" || v"1.8-beta2" <= VERSION < v"1.9-" || VERSION v"1.9.0-DEV.190"
343343
@test !occursin("alloca", ir)
344344
else
345345
@test_broken !occursin("alloca", ir)

0 commit comments

Comments
 (0)