@@ -122,7 +122,37 @@ function find_callsites(provider::AbstractProvider, result::LookupResult, ci::Co
122122 return callsites, sourcenodes
123123end
124124
125- function process_const_info (provider:: AbstractProvider , :: LookupResult , @nospecialize (thisinfo),
125+ @static if VERSION ≥ v " 1.14.0-DEV.60"
126+ function process_result (
127+ :: AbstractProvider , :: LookupResult , argtypes:: ArgTypes ,
128+ @nospecialize (rt), @nospecialize (result), @nospecialize (exct)
129+ )
130+ if isnothing (result)
131+ return nothing
132+ elseif isa (result, CC. ConcreteResult)
133+ edge = result. edge
134+ effects = get_effects (result)
135+ mici = EdgeCallInfo (edge, rt, effects, exct)
136+ return ConcreteCallInfo (mici, argtypes)
137+ elseif isa (result, CC. SemiConcreteResult)
138+ effects = get_effects (result)
139+ mici = EdgeCallInfo (result. edge, rt, effects, exct)
140+ return SemiConcreteCallInfo (mici, result. ir)
141+ else
142+ @assert isa (result, CC. InferenceResult)
143+ overridden_by_const = result. overridden_by_const
144+ if overridden_by_const != = nothing && any (overridden_by_const)
145+ effects = get_effects (result)
146+ mici = EdgeCallInfo (result. ci_as_edge, rt, effects, exct)
147+ return ConstPropCallInfo (mici, result)
148+ else
149+ effects = get_effects (result)
150+ return EdgeCallInfo (result. ci_as_edge, rt, effects, exct)
151+ end
152+ end
153+ end
154+ else
155+ function process_const_info (:: AbstractProvider , :: LookupResult , @nospecialize (thisinfo),
126156 argtypes:: ArgTypes , @nospecialize (rt), @nospecialize (result),
127157 @nospecialize (exct))
128158 if isnothing (result)
@@ -152,6 +182,7 @@ function process_const_info(provider::AbstractProvider, ::LookupResult, @nospeci
152182 return ConstPropCallInfo (mici, result)
153183 end
154184end
185+ end
155186
156187function process_info (provider:: AbstractProvider , result:: LookupResult , @nospecialize (info:: CCCallInfo ),
157188 argtypes:: ArgTypes , @nospecialize (rt),
@@ -176,10 +207,16 @@ function process_info(provider::AbstractProvider, result::LookupResult, @nospeci
176207 if edge === nothing
177208 RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct)
178209 else
210+ @static if VERSION ≥ v " 1.14.0-DEV.60"
211+ @something (
212+ process_result (provider, result, argtypes, rt, info. call_results[i], exct),
213+ RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct))
214+ else
179215 effects = @something (effects, get_effects (edge))
180216 EdgeCallInfo (edge, rt, effects, exct)
217+ end
181218 end
182- end for edge in info. edges if edge != = nothing ]
219+ end for (i, edge) in enumerate ( info. edges) if edge != = nothing ]
183220 elseif isa (info, UnionSplitInfo)
184221 return mapreduce (process_recursive, vcat, info. split; init= CallInfo[]):: Vector{CallInfo}
185222 elseif isa (info, UnionSplitApplyCallInfo)
@@ -188,7 +225,7 @@ function process_info(provider::AbstractProvider, result::LookupResult, @nospeci
188225 # XXX : This could probably use its own info. For now,
189226 # we ignore any implicit iterate calls.
190227 return process_recursive (info. call)
191- elseif isa (info, ConstCallInfo)
228+ elseif ( @static VERSION < v " 1.14.0-DEV.60 " ? true : false ) && isa (info, CC . ConstCallInfo)
192229 infos = process_recursive (info. call)
193230 @assert length (infos) == length (info. results)
194231 return CallInfo[let
@@ -197,9 +234,15 @@ function process_info(provider::AbstractProvider, result::LookupResult, @nospeci
197234 elseif isa (info, CC. InvokeCallInfo)
198235 edge = info. edge
199236 if edge != = nothing
237+ @static if VERSION ≥ v " 1.14.0-DEV.60"
238+ innerinfo = @something (
239+ process_result (provider, result, argtypes, rt, info. result, exct),
240+ RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct))
241+ else
200242 effects = @something (effects, get_effects (edge))
201243 thisinfo = EdgeCallInfo (edge, rt, effects)
202244 innerinfo = process_const_info (provider, result, thisinfo, argtypes, rt, info. result, exct)
245+ end
203246 else
204247 innerinfo = RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct)
205248 end
@@ -208,9 +251,15 @@ function process_info(provider::AbstractProvider, result::LookupResult, @nospeci
208251 elseif isa (info, CC. OpaqueClosureCallInfo)
209252 edge = info. edge
210253 if edge != = nothing
254+ @static if VERSION ≥ v " 1.14.0-DEV.60"
255+ innerinfo = @something (
256+ process_result (provider, result, argtypes, rt, info. result, exct),
257+ RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct))
258+ else
211259 effects = @something (effects, get_effects (edge))
212260 thisinfo = EdgeCallInfo (edge, rt, effects)
213261 innerinfo = process_const_info (provider, result, thisinfo, argtypes, rt, info. result, exct)
262+ end
214263 else
215264 innerinfo = RTCallInfo (unwrapconst (argtypes[1 ]), argtypes[2 : end ], rt, exct)
216265 end
0 commit comments