Skip to content

Commit

Permalink
move unused inspection utilities to test/setup.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jul 17, 2023
1 parent be7664a commit 71867a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ end

islnn(@nospecialize(x)) = isa(x, LineNumberNode)

# for inspection
macro lwr(ex) QuoteNode(lower(__module__, ex)) end
macro src(ex) QuoteNode(first(lower(__module__, ex).args)) end

"""
@withmixedhash (mutable) struct T
fields ...
Expand Down
4 changes: 4 additions & 0 deletions test/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ function test_sum_over_string(ers)
end
test_sum_over_string(res::JET.JETCallResult) = test_sum_over_string(get_reports_with_test(res))
test_sum_over_string(res::JET.JETToplevelResult) = test_sum_over_string(get_reports_with_test(res))

# for inspection
macro lwr(ex) QuoteNode(Meta.lower(__module__, ex)) end
macro src(ex) QuoteNode(only(Meta.lower(__module__, ex).args)) end
3 changes: 1 addition & 2 deletions test/toplevel/test_virtualprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1696,8 +1696,7 @@ end

# simple negative case test, which checks we do NOT select statements not involved with any definition
# this particular example is adapted from https://en.wikipedia.org/wiki/Program_slicing
let
src = JET.@src let
let src = @src let
sum = 0
product = 1 # should NOT be selected
w = 7
Expand Down

0 comments on commit 71867a0

Please sign in to comment.