276
276
# TODO : `get_remarks` should get a cursor?
277
277
# Cthulhu.get_remarks(interp::ADInterpreter, key::Union{MethodInstance,InferenceResult}) = get(interp.remarks[interp.current_level], key, nothing)
278
278
279
- @static if VERSION ≥ v " 1.13.0-DEV.126"
279
+ @static if VERSION ≥ v " 1.13-"
280
+ function diffractor_finish (@specialize (finishfunc), state:: InferenceState , interp:: ADInterpreter , cycleid:: Int , opt_cache:: IdDict{MethodInstance, CodeInstance} )
281
+ res = @invoke finishfunc (state:: InferenceState , interp:: AbstractInterpreter , cycleid:: Int , opt_cache:: IdDict{MethodInstance, CodeInstance} )
282
+ key = CC. is_constproped (state) ? state. result : state. linfo
283
+ interp. unopt[interp. current_level][key] = Cthulhu. InferredSource (state)
284
+ return res
285
+ end
286
+ elseif VERSION ≥ v " 1.12-"
280
287
function diffractor_finish (@specialize (finishfunc), state:: InferenceState , interp:: ADInterpreter , cycleid:: Int )
281
288
res = @invoke finishfunc (state:: InferenceState , interp:: AbstractInterpreter , cycleid:: Int )
282
289
key = CC. is_constproped (state) ? state. result : state. linfo
@@ -292,7 +299,9 @@ function diffractor_finish(@specialize(finishfunc), state::InferenceState, inter
292
299
end
293
300
end
294
301
295
- @static if VERSION ≥ v " 1.12-"
302
+ @static if VERSION ≥ v " 1.13-"
303
+ CC. finishinfer! (state:: InferenceState , interp:: ADInterpreter , cycleid:: Int , opt_cache:: IdDict{MethodInstance, CodeInstance} ) = diffractor_finish (CC. finishinfer!, state, interp, cycleid, opt_cache)
304
+ elseif VERSION ≥ v " 1.12-"
296
305
CC. finishinfer! (state:: InferenceState , interp:: ADInterpreter , cycleid:: Int ) = diffractor_finish (CC. finishinfer!, state, interp, cycleid)
297
306
function CC. finish! (interp:: ADInterpreter , caller:: InferenceState , validation_world:: UInt , time_before:: UInt64 )
298
307
Cthulhu. set_cthulhu_source! (caller. result)
0 commit comments