Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 21, 2025
1 parent b9acd65 commit 0b61fc2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
8 changes: 2 additions & 6 deletions src/JETBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using .CC: @nospecs, ⊑,
nearest_common_dominator, singleton_type, slot_id, specialize_method, tmeet, tmerge,
typeinf_lattice, widenconst, widenlattice

using Base: IdSet, get_world_counter
using Base: IdSet, get_world_counter, generating_output

using Base.Meta: ParseError, isexpr, lower

Expand Down Expand Up @@ -89,10 +89,6 @@ __init__() = foreach(@nospecialize(f)->f(), INIT_HOOKS)
# compat
# ------

using Base: generating_output

import .CC: get_inference_world

# macros
# ------

Expand Down Expand Up @@ -617,7 +613,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=CC.method_table(analyzer), world=get_inference_world(analyzer), raise=false)
match = Base._which(tt; method_table=CC.method_table(analyzer), world=CC.get_inference_world(analyzer), raise=false)
match === nothing && single_match_error(tt)
return match
end
Expand Down
14 changes: 7 additions & 7 deletions src/JETEmpty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const empty_stub_message = strip("""
even with `JET_DEV_MODE` enabled.
""")

for exported_func in filter(name::Symbol->!startswith(String(name), "@"), exports)
@eval $exported_func(args...; kws...) = error($(GlobalRef(@__MODULE__, :empty_stub_message)))
end

for exported_macro in filter(name::Symbol->startswith(String(name), "@"), exports)
exported_macro_name = Symbol(lstrip(String(exported_macro), '@'))
@eval macro $exported_macro_name(exs...); :(error($(GlobalRef(@__MODULE__, :empty_stub_message)))); end
for exported_func in exports
if startswith(String(exported_func), "@")
exported_macro_name = Symbol(lstrip(String(exported_macro), '@'))
@eval macro $exported_macro_name(exs...); :(error($(GlobalRef(@__MODULE__, :empty_stub_message)))); end
else
@eval $exported_func(args...; kws...) = error($(GlobalRef(@__MODULE__, :empty_stub_message)))
end
end
7 changes: 3 additions & 4 deletions src/abstractinterpret/abstractanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,11 @@ 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_inference_world(analyzer);
newstate = AnalyzerState(CC.get_inference_world(analyzer);
results = get_results(analyzer),
inf_params = InferenceParams(analyzer),
opt_params = OptimizationParams(analyzer),
depth = get_depth(analyzer),
)
depth = get_depth(analyzer))
return AbstractAnalyzer(analyzer, newstate)
end

Expand Down Expand Up @@ -534,7 +533,7 @@ stash_report!(analyzer::AbstractAnalyzer, reports::Vector{InferenceErrorReport})

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

# allow compression during precompilation only
CC.may_compress(::AbstractAnalyzer) = generating_output()
Expand Down
2 changes: 1 addition & 1 deletion src/abstractinterpret/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ CC.cache_owner(analyzer::AbstractAnalyzer) = AnalysisCache(analyzer)

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

Expand Down
2 changes: 1 addition & 1 deletion src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function (::SoundBasicPass)(::Type{GeneratorErrorReport}, analyzer::JETAnalyzer,
if isdefined(m, :generator)
# analyze_method_instance!(analyzer, linfo) XXX doesn't work
CC.may_invoke_generator(mi) || return false
world = get_inference_world(analyzer)
world = CC.get_inference_world(analyzer)
try
@ccall jl_code_for_staged(mi::Any, world::UInt)::Any
catch err
Expand Down

0 comments on commit 0b61fc2

Please sign in to comment.