Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 8, 2024
1 parent ae34c77 commit 537439f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
13 changes: 10 additions & 3 deletions src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import .CC:
# get, getindex, haskey, push!, setindex!,
#= types.jl =#
InferenceParams, OptimizationParams, add_remark!, bail_out_call, bail_out_toplevel_call,
code_cache, get_inference_cache, get_world_counter, lock_mi_inference, may_compress,
may_discard_trees, may_optimize, unlock_mi_inference, verbose_stmt_info, method_table,
code_cache, get_inference_cache, lock_mi_inference, may_compress, may_discard_trees,
may_optimize, unlock_mi_inference, verbose_stmt_info, method_table,
#= inferenceresult.jl =#
cache_lookup,
#= inferencestate.jl =#
Expand Down Expand Up @@ -125,6 +125,13 @@ __init__() = foreach(@nospecialize(f)->f(), INIT_HOOKS)
# compat
# ------

@static if VERSION v"1.11.0-DEV.1498"
import .CC: get_inference_world
using Base: get_world_counter
else
import .CC: get_world_counter, get_world_counter as get_inference_world
end

# macros
# ------

Expand Down Expand Up @@ -636,7 +643,7 @@ function analyze_gf_by_type!(analyzer::AbstractAnalyzer, @nospecialize(tt::Type{
end

function find_single_match(@nospecialize(tt), analyzer::AbstractAnalyzer)
match = Base._which(tt; method_table=method_table(analyzer), world=get_world_counter(analyzer), raise=false)
match = Base._which(tt; method_table=method_table(analyzer), world=get_inference_world(analyzer), raise=false)
match === nothing && single_match_error(tt)
return match
end
Expand Down
8 changes: 4 additions & 4 deletions src/abstractinterpret/abstractanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ end

# constructor for additional JET analysis in the middle of parent (non top-level) abstractinterpret
function AbstractAnalyzer(analyzer::T) where {T<:AbstractAnalyzer}
newstate = AnalyzerState(get_world_counter(analyzer);
newstate = AnalyzerState(get_inference_world(analyzer);
results = get_results(analyzer),
inf_params = InferenceParams(analyzer),
opt_params = OptimizationParams(analyzer),
Expand Down Expand Up @@ -546,11 +546,11 @@ stash_report!(analyzer::AbstractAnalyzer, reports::Vector{InferenceErrorReport})
# ===================
# provide default implementations for the API requirements

CC.InferenceParams(analyzer::AbstractAnalyzer) = get_inf_params(analyzer)
CC.InferenceParams(analyzer::AbstractAnalyzer) = get_inf_params(analyzer)
CC.OptimizationParams(analyzer::AbstractAnalyzer) = get_opt_params(analyzer)
CC.get_world_counter(analyzer::AbstractAnalyzer) = get_world(analyzer)
#=CC.=#get_inference_world(analyzer::AbstractAnalyzer) = get_world(analyzer)

CC.may_compress(analyzer::AbstractAnalyzer) = false
CC.may_compress(analyzer::AbstractAnalyzer) = false
CC.may_discard_trees(analyzer::AbstractAnalyzer) = false

let # overload `inlining_policy`
Expand Down
2 changes: 1 addition & 1 deletion src/abstractinterpret/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ end

function CC.code_cache(analyzer::AbstractAnalyzer)
view = AbstractAnalyzerView(analyzer)
worlds = WorldRange(get_world_counter(analyzer))
worlds = WorldRange(get_inference_world(analyzer))
return WorldView(view, worlds)
end

Expand Down

0 comments on commit 537439f

Please sign in to comment.