Skip to content

Commit cc41cfa

Browse files
authored
Merge pull request #427 from JuliaGPU/tb/dev
Minor fixes
2 parents a203f04 + d6a553b commit cc41cfa

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GPUCompiler"
22
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
33
authors = ["Tim Besard <tim.besard@gmail.com>"]
4-
version = "0.19.0"
4+
version = "0.19.1"
55

66
[deps]
77
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"

src/irgen.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function safe_name(t::Type{<:Function})
205205
end
206206
safe_name(string(fn))
207207
end
208+
safe_name(::Type{Union{}}) = "Bottom"
208209
safe_name(x) = safe_name(repr(x))
209210

210211

src/jlgen.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,15 @@ function methodinstance(ft::Type, tt::Type, world::Integer=tls_world_age())
224224
sig = typed_signature(ft, tt)
225225

226226
# look-up the method
227-
meth = if VERSION >= v"1.10.0-DEV.65"
228-
Base._which(sig; world).method
227+
if VERSION >= v"1.10.0-DEV.65"
228+
meth = Base._which(sig; world).method
229229
elseif VERSION >= v"1.7.0-DEV.435"
230-
Base._which(sig, world).method
230+
meth = Base._which(sig, world).method
231231
else
232-
ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), sig, world)
232+
meth = ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), sig, world)
233+
if meth == nothing
234+
error("no unique matching method found for the specified argument types")
235+
end
233236
end
234237

235238
(ti, env) = ccall(:jl_type_intersection_with_env, Any,

src/reflection.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ function code_warntype(io::IO, @nospecialize(job::CompilerJob); interactive::Boo
7878
# call Cthulhu without introducing a dependency on Cthulhu
7979
mod = get(Base.loaded_modules, Cthulhu, nothing)
8080
mod===nothing && error("Interactive code reflection requires Cthulhu; please install and load this package first.")
81-
interp = get_interpreter(job)
82-
descend_code_warntype = getfield(mod, :descend_code_warntype)
83-
descend_code_warntype(sig; interp, kwargs...)
81+
if VERSION < v"1.7-"
82+
descend_code_typed = getfield(mod, :descend_code_typed)
83+
descend_code_typed(job.source; kwargs...)
84+
else
85+
interp = get_interpreter(job)
86+
descend_code_warntype = getfield(mod, :descend_code_warntype)
87+
descend_code_warntype(sig; interp, kwargs...)
88+
end
8489
elseif VERSION >= v"1.7-"
8590
interp = get_interpreter(job)
8691
code_warntype_by_type(io, sig; interp, kwargs...)

test/definitions/native.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ module LazyCodegen
114114
@assert !cc.compiled
115115
job = cc.job
116116

117-
name, jitted_mod = JuliaContext() do ctx
117+
entry_name, jitted_mod = JuliaContext() do ctx
118118
ir, meta = GPUCompiler.compile(:llvm, job; validate=false, ctx)
119119
name(meta.entry), compile!(orc, ir)
120120
end
121121

122-
addr = addressin(orc, jitted_mod, name)
122+
addr = addressin(orc, jitted_mod, entry_name)
123123
ptr = pointer(addr)
124124

125125
cc.compiled = true

0 commit comments

Comments
 (0)