diff --git a/src/analysis/forward.jl b/src/analysis/forward.jl index 1078cbaa..66feaadd 100644 --- a/src/analysis/forward.jl +++ b/src/analysis/forward.jl @@ -45,13 +45,11 @@ function fwd_abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize frc = frule_call[] pc = primal_call[] - if frc.rt !== Const(nothing) - result[] = CallMeta(pc.rt, pc.exct, pc.effects, FRuleCallInfo(pc.info, frc)) - else - result[] = pc + if VERSION < v"1.12.0-DEV.1531" && frc.rt === Const(nothing) CC.add_mt_backedge!(sv, frule_mt, frule_atype) end + result[] = CallMeta(pc.rt, pc.exct, pc.effects, FRuleCallInfo(pc.info, frc)) return true end (!isready(primal_call) || !make_progress(interp, sv)) && push!(sv.tasks, make_progress) @@ -89,7 +87,7 @@ function fwd_abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize @static if VERSION ≥ v"1.11.0-DEV.945" return CallMeta(primal_call.rt, primal_call.exct, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call)) else - return CallMeta(primal_call.rt, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call)) + return CallMeta(primal_call.rt, primal_call.effects, FRuleCallInfo(primal_call.info, frule_call.info)) end else CC.add_mt_backedge!(sv, frule_mt, frule_atype) diff --git a/src/stage2/lattice.jl b/src/stage2/lattice.jl index ade95ed4..34f193ba 100644 --- a/src/stage2/lattice.jl +++ b/src/stage2/lattice.jl @@ -66,7 +66,9 @@ end struct FRuleCallInfo <: CallInfo info::CallInfo frule_call::CallMeta - FRuleCallInfo(@nospecialize(info::CallInfo), frule_call::CallMeta) = new(info, frule_call) + function FRuleCallInfo(@nospecialize(info::CallInfo), frule_call::CallMeta) + new(info, frule_call) + end end CC.nsplit_impl(info::FRuleCallInfo) = CC.nsplit(info.info) CC.getsplit_impl(info::FRuleCallInfo, idx::Int) = CC.getsplit(info.info, idx) @@ -74,6 +76,12 @@ CC.getresult_impl(info::FRuleCallInfo, idx::Int) = CC.getresult(info.info, idx) if isdefined(CC, :add_uncovered_edges_impl) CC.add_uncovered_edges_impl(edges::Vector{Any}, info::FRuleCallInfo, @nospecialize(atype)) = CC.add_uncovered_edges!(edges, info.info, atype) end +if isdefined(CC, :add_edges_impl) + function CC.add_edges_impl(edges::Vector{Any}, info::FRuleCallInfo) + CC.add_edges!(edges, info.info) + CC.add_edges!(edges, info.frule_call.info) + end +end function Base.show(io::IO, info::FRuleCallInfo) print(io, "FRuleCallInfo(", typeof(info.info), ", ", typeof(info.frule_call.info), ")")