From 9de574325424f91b76f6476d9990ddef92381c40 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 7 Nov 2023 21:06:21 +0900 Subject: [PATCH] adjust to JuliaLang/julia#51934 --- src/interpreter.jl | 5 +++++ src/reflection.jl | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/interpreter.jl b/src/interpreter.jl index a9db2a18..5b8d7b9c 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(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)