276276# TODO : `get_remarks` should get a cursor?
277277# Cthulhu.get_remarks(interp::ADInterpreter, key::Union{MethodInstance,InferenceResult}) = get(interp.remarks[interp.current_level], key, nothing)
278278
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-"
280287function diffractor_finish (@specialize (finishfunc), state:: InferenceState , interp:: ADInterpreter , cycleid:: Int )
281288 res = @invoke finishfunc (state:: InferenceState , interp:: AbstractInterpreter , cycleid:: Int )
282289 key = CC. is_constproped (state) ? state. result : state. linfo
@@ -292,7 +299,9 @@ function diffractor_finish(@specialize(finishfunc), state::InferenceState, inter
292299end
293300end
294301
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-"
296305CC. finishinfer! (state:: InferenceState , interp:: ADInterpreter , cycleid:: Int ) = diffractor_finish (CC. finishinfer!, state, interp, cycleid)
297306function CC. finish! (interp:: ADInterpreter , caller:: InferenceState , validation_world:: UInt , time_before:: UInt64 )
298307 Cthulhu. set_cthulhu_source! (caller. result)
0 commit comments