diff --git a/src/interpreter.jl b/src/interpreter.jl index a9db2a18..101eb17b 100644 --- a/src/interpreter.jl +++ b/src/interpreter.jl @@ -53,7 +53,12 @@ import .CC: InferenceParams, OptimizationParams, get_world_counter, using Base: @invoke CC.InferenceParams(interp::CthulhuInterpreter) = InferenceParams(interp.native) +@static if VERSION ≥ v"1.11.0-DEV.851" +CC.OptimizationParams(interp::CthulhuInterpreter) = OptimizationParams(interp.native; + preserve_local_sources=true) +else CC.OptimizationParams(interp::CthulhuInterpreter) = OptimizationParams(interp.native) +end CC.get_world_counter(interp::CthulhuInterpreter) = get_world_counter(interp.native) CC.get_inference_cache(interp::CthulhuInterpreter) = get_inference_cache(interp.native) diff --git a/src/reflection.jl b/src/reflection.jl index 6f559910..a4e03062 100644 --- a/src/reflection.jl +++ b/src/reflection.jl @@ -121,6 +121,10 @@ function process_const_info(interp::AbstractInterpreter, @nospecialize(thisinfo) if isnothing(result) return thisinfo + elseif (@static VERSION ≥ v"1.11.0-DEV.851" && true) && result isa CC.VolatileInferenceResult + # NOTE we would not hit this case since `finish!(::CthulhuInterpreter, frame::InferenceState)` + # will always transform `frame.result.src` to `OptimizedSource` when frame is inferred + return thisinfo elseif (@static VERSION ≥ v"1.9-" && true) && isa(result, CC.ConcreteResult) linfo = result.mi effects = get_effects(result)