Skip to content

Commit

Permalink
strip non-unnecessary Base. suffixes from Base.@invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Nov 1, 2023
1 parent 81abb2a commit 8b56fde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/find_unstable_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function CC.abstract_eval_special_value(analyzer::UnstableAPIAnalyzer, @nospecia
end

## recurse into JET's default abstract interpretation routine
return Base.@invoke CC.abstract_eval_special_value(analyzer::AbstractAnalyzer, e, vtypes::CC.VarTable, sv::CC.InferenceState)
return @invoke CC.abstract_eval_special_value(analyzer::AbstractAnalyzer, e, vtypes::CC.VarTable, sv::CC.InferenceState)
end

function CC.builtin_tfunction(analyzer::UnstableAPIAnalyzer, @nospecialize(f), argtypes::Vector{Any}, sv::CC.InferenceState)
Expand All @@ -88,7 +88,7 @@ function CC.builtin_tfunction(analyzer::UnstableAPIAnalyzer, @nospecialize(f), a
end

## recurse into JET's default abstract interpretation routine
return Base.@invoke CC.builtin_tfunction(analyzer::AbstractAnalyzer, f, argtypes::Vector{Any}, sv::CC.InferenceState)
return @invoke CC.builtin_tfunction(analyzer::AbstractAnalyzer, f, argtypes::Vector{Any}, sv::CC.InferenceState)
end

# Additionally, we can cut off the performance cost involved with Julia's native compiler's optimizations passes:
Expand Down
6 changes: 3 additions & 3 deletions test/analyzers/test_jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ end

# invalid `argtype`
result = report_call() do
Base.@invoke sin(1.0::Int)
@invoke sin(1.0::Int)
end
@test length(get_reports_with_test(result)) == 1
r = first(get_reports_with_test(result))
Expand All @@ -582,7 +582,7 @@ end
result = @eval Module() begin
foo(i::Integer) = throw(string(i))
$report_call((Int,)) do a
Base.@invoke foo(a::Integer)
@invoke foo(a::Integer)
end
end
@test !isempty(get_reports_with_test(result))
Expand All @@ -595,7 +595,7 @@ end
bar(a) = return a + undefvar
function baz(a)
a += 1
Base.@invoke bar(a::Int) # `invoke` is valid, but error should happen within `bar`
@invoke bar(a::Int) # `invoke` is valid, but error should happen within `bar`
end
$report_call(baz, (Any,))
end
Expand Down

0 comments on commit 8b56fde

Please sign in to comment.