Skip to content

Commit 810e53f

Browse files
committed
Remove redundant argument from jl_get_llvmf
1 parent f6befb6 commit 810e53f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

base/reflection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ uncompressed_ast(l::LambdaInfo) =
254254
# Printing code representations in IR and assembly
255255
function _dump_function(f, t::ANY, native, wrapper, strip_ir_metadata, dump_module)
256256
t = tt_cons(Core.Typeof(f), to_tuple_type(t))
257-
llvmf = ccall(:jl_get_llvmf, Ptr{Void}, (Any, Any, Bool, Bool), f, t, wrapper, native)
257+
llvmf = ccall(:jl_get_llvmf, Ptr{Void}, (Any, Bool, Bool), t, wrapper, native)
258258

259259
if llvmf == C_NULL
260260
error("no method found for the specified argument types")

src/codegen.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,14 +1174,15 @@ void jl_extern_c(jl_function_t *f, jl_value_t *rt, jl_value_t *argt, char *name)
11741174
// this is paired with jl_dump_function_ir and jl_dump_function_asm in particular ways:
11751175
// misuse will leak memory or cause read-after-free
11761176
extern "C" JL_DLLEXPORT
1177-
void *jl_get_llvmf(jl_function_t *f, jl_tupletype_t *tt, bool getwrapper, bool getdeclarations)
1177+
void *jl_get_llvmf(jl_tupletype_t *tt, bool getwrapper, bool getdeclarations)
11781178
{
11791179
jl_lambda_info_t *linfo = NULL;
11801180
JL_GC_PUSH2(&linfo, &tt);
11811181
if (tt != NULL) {
11821182
linfo = jl_get_specialization1(tt);
11831183
if (linfo == NULL) {
1184-
linfo = jl_method_lookup_by_type(jl_gf_mtable(f), tt, 0, 0);
1184+
linfo = jl_method_lookup_by_type(
1185+
((jl_datatype_t*)jl_tparam0(tt))->name->mt, tt, 0, 0);
11851186
if (linfo == NULL) {
11861187
JL_GC_POP();
11871188
return NULL;

test/reflection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ definitely_not_in_sysimg() = nothing
276276
for (f,t) in ((definitely_not_in_sysimg,Tuple{}),
277277
(Base.throw_boundserror,Tuple{UnitRange{Int64},Int64}))
278278
t = Base.tt_cons(Core.Typeof(f), Base.to_tuple_type(t))
279-
llvmf = ccall(:jl_get_llvmf, Ptr{Void}, (Any, Any, Bool, Bool), f, t, false, true)
279+
llvmf = ccall(:jl_get_llvmf, Ptr{Void}, (Any, Bool, Bool), t, false, true)
280280
@test llvmf != C_NULL
281281
@test ccall(:jl_get_llvm_fptr, Ptr{Void}, (Ptr{Void},), llvmf) != C_NULL
282282
end

0 commit comments

Comments
 (0)