@@ -105,7 +105,7 @@ jl_get_llvm_mis_impl(void *native_code, size_t *num_elements, jl_method_instance
105
105
assert (*num_elements == map.size ());
106
106
size_t i = 0 ;
107
107
for (auto &ci : map) {
108
- data[i++] = ci.first -> def ;
108
+ data[i++] = jl_get_ci_mi ( ci.first ) ;
109
109
}
110
110
}
111
111
@@ -455,14 +455,14 @@ static void compile_workqueue(jl_codegen_params_t ¶ms, egal_set &method_root
455
455
if ((policy != CompilationPolicy::Default || params.params ->trim ) &&
456
456
jl_atomic_load_relaxed (&codeinst->inferred ) == jl_nothing) {
457
457
// XXX: SOURCE_MODE_FORCE_SOURCE is wrong here (neither sufficient nor necessary)
458
- codeinst = jl_type_infer (codeinst-> def , jl_atomic_load_relaxed (&codeinst->max_world ), SOURCE_MODE_FORCE_SOURCE);
458
+ codeinst = jl_type_infer (jl_get_ci_mi ( codeinst) , jl_atomic_load_relaxed (&codeinst->max_world ), SOURCE_MODE_FORCE_SOURCE);
459
459
}
460
460
if (codeinst) {
461
461
orc::ThreadSafeModule result_m =
462
- jl_create_ts_module (name_from_method_instance (codeinst-> def ),
462
+ jl_create_ts_module (name_from_method_instance (jl_get_ci_mi ( codeinst) ),
463
463
params.tsctx , params.DL , params.TargetTriple );
464
464
auto decls = jl_emit_codeinst (result_m, codeinst, NULL , params);
465
- record_method_roots (method_roots, codeinst-> def );
465
+ record_method_roots (method_roots, jl_get_ci_mi ( codeinst) );
466
466
if (result_m)
467
467
it = compiled_functions.insert (std::make_pair (codeinst, std::make_pair (std::move (result_m), std::move (decls)))).first ;
468
468
}
@@ -501,7 +501,7 @@ static void compile_workqueue(jl_codegen_params_t ¶ms, egal_set &method_root
501
501
proto.decl ->setLinkage (GlobalVariable::InternalLinkage);
502
502
// protodecl->setAlwaysInline();
503
503
jl_init_function (proto.decl , params.TargetTriple );
504
- jl_method_instance_t *mi = codeinst-> def ;
504
+ jl_method_instance_t *mi = jl_get_ci_mi ( codeinst) ;
505
505
size_t nrealargs = jl_nparams (mi->specTypes ); // number of actual arguments being passed
506
506
bool is_opaque_closure = jl_is_method (mi->def .value ) && mi->def .method ->is_for_opaque_closure ;
507
507
// TODO: maybe this can be cached in codeinst->specfptr?
@@ -641,12 +641,12 @@ void *jl_create_native_impl(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvm
641
641
data->jl_fvar_map [codeinst] = std::make_tuple ((uint32_t )-3 , (uint32_t )-3 );
642
642
}
643
643
else {
644
- orc::ThreadSafeModule result_m = jl_create_ts_module (name_from_method_instance (codeinst-> def ),
644
+ orc::ThreadSafeModule result_m = jl_create_ts_module (name_from_method_instance (jl_get_ci_mi ( codeinst) ),
645
645
params.tsctx , clone.getModuleUnlocked ()->getDataLayout (),
646
646
Triple (clone.getModuleUnlocked ()->getTargetTriple ()));
647
647
jl_llvm_functions_t decls = jl_emit_codeinst (result_m, codeinst, NULL , params);
648
648
JL_GC_PROMISE_ROOTED (codeinst->def ); // analyzer seems confused
649
- record_method_roots (method_roots, codeinst-> def );
649
+ record_method_roots (method_roots, jl_get_ci_mi ( codeinst) );
650
650
if (result_m)
651
651
compiled_functions[codeinst] = {std::move (result_m), std::move (decls)};
652
652
else if (jl_options.trim != JL_TRIM_NO) {
@@ -2267,7 +2267,7 @@ void jl_get_llvmf_defn_impl(jl_llvmf_dump_t* dump, jl_method_instance_t *mi, jl_
2267
2267
// To get correct names in the IR this needs to be at least 2
2268
2268
output.temporary_roots = jl_alloc_array_1d (jl_array_any_type, 0 );
2269
2269
JL_GC_PUSH1 (&output.temporary_roots );
2270
- auto decls = jl_emit_code (m, mi, src, output);
2270
+ auto decls = jl_emit_code (m, mi, src, NULL , output);
2271
2271
output.temporary_roots = nullptr ;
2272
2272
JL_GC_POP (); // GC the global_targets array contents now since reflection doesn't need it
2273
2273
0 commit comments