Skip to content

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 25, 2024
1 parent 56520e0 commit 714f0ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
38 changes: 18 additions & 20 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, lock_mi_inference, may_compress, may_discard_trees,
may_optimize, unlock_mi_inference, verbose_stmt_info, method_table,
code_cache, get_inference_cache, may_compress, may_discard_trees, may_optimize,
method_table,
#= inferenceresult.jl =#
cache_lookup,
#= inferencestate.jl =#
Expand All @@ -61,14 +61,14 @@ import Test: record
# ======

using Core:
Argument, Builtin, CodeInfo, CodeInstance, Const, GlobalRef, GotoIfNot, GotoNode,
IntrinsicFunction, Intrinsics, LineInfoNode, MethodInstance, MethodMatch, MethodTable,
Argument, Builtin, CodeInfo, CodeInstance, Const, GlobalRef, GotoIfNot,
IntrinsicFunction, Intrinsics, LineInfoNode, MethodInstance,
ReturnNode, SSAValue, SimpleVector, SlotNumber, svec

using .CC: @nospecs, ,
AbstractInterpreter, ArgInfo, BasicBlock, Bottom, CFG, CachedMethodTable, CallMeta,
ConstCallInfo, InferenceResult, InternalMethodTable, InvokeCallInfo, LimitedAccuracy,
MethodCallResult, MethodLookupResult, MethodMatchInfo, MethodMatches, NOT_FOUND,
AbstractInterpreter, ArgInfo, Bottom, CFG, CachedMethodTable, CallMeta,
ConstCallInfo, InferenceResult, InternalMethodTable, InvokeCallInfo,
MethodCallResult, MethodMatchInfo, MethodMatches, NOT_FOUND,
OptimizationState, OverlayMethodTable, StmtInfo, UnionSplitInfo, UnionSplitMethodMatches,
VarState, VarTable, WorldRange, WorldView,
argextype, argtype_by_index, argtype_tail, argtypes_to_type, compute_basic_blocks,
Expand All @@ -83,35 +83,33 @@ using Base.Meta: ParseError, _parse_string, isexpr, lower

using Base.Experimental: @MethodTable, @overlay

using LoweredCodeUtils, JuliaInterpreter

using LoweredCodeUtils:
#=NamedVar,=# add_control_flow!, #=add_named_dependencies!, add_requests!,=#
add_ssa_preds!, add_typedefs!, callee_matches, find_typedefs, ismethod, istypedef,
print_with_code, pushall!, rng
CodeEdges, #=NamedVar,=# LoweredCodeUtils, add_control_flow!, #=add_named_dependencies!,
add_requests!,=# add_ssa_preds!, add_typedefs!, callee_matches, find_typedefs, ismethod,
istypedef, print_with_code, pushall!, rng

using JuliaInterpreter:
@lookup, _INACTIVE_EXCEPTION, bypass_builtins, collect_args, #=finish!,=#
is_quotenode_egal, maybe_evaluate_builtin, moduleof
@lookup, _INACTIVE_EXCEPTION, Frame, JuliaInterpreter, bypass_builtins, collect_args,
#=finish!,=# is_quotenode_egal, maybe_evaluate_builtin, moduleof

using MacroTools: @capture, MacroTools, normalise, striplines
using MacroTools: @capture, normalise, striplines

using InteractiveUtils
using InteractiveUtils: gen_call_with_extracted_types_and_kwargs

using Pkg, Pkg.TOML
using Pkg: Pkg, TOML

using Test:
Broken, DefaultTestSet, Error, Fail, FallbackTestSet, FallbackTestSetException, Pass,
Result, TESTSET_PRINT_ENABLE, Test, get_testset

using Preferences
using Preferences: Preferences

# common
# ======

const Argtypes = Vector{Any}

const JET_DEV_MODE = @load_preference("JET_DEV_MODE", false)
const JET_DEV_MODE = Preferences.@load_preference("JET_DEV_MODE", false)

const CONFIG_FILE_NAME = ".JET.toml"

Expand Down Expand Up @@ -1103,7 +1101,7 @@ function call_test_ex(funcname::Symbol, testname::Symbol, ex0, __module__, __sou
end

function _call_test_ex(funcname::Symbol, testname::Symbol, ex0, __module__, __source__)
analysis = InteractiveUtils.gen_call_with_extracted_types_and_kwargs(__module__, funcname, ex0)
analysis = gen_call_with_extracted_types_and_kwargs(__module__, funcname, ex0)
orig_expr = QuoteNode(Expr(:macrocall, GlobalRef(@__MODULE__, testname), __source__, ex0...))
source = QuoteNode(__source__)
testres = :(try
Expand Down
2 changes: 1 addition & 1 deletion src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ The [general configurations](@ref) and [the error analysis specific configuratio
can be specified as an optional argument.
"""
macro report_call(ex0...)
return InteractiveUtils.gen_call_with_extracted_types_and_kwargs(__module__, :report_call, ex0)
return gen_call_with_extracted_types_and_kwargs(__module__, :report_call, ex0)
end

# Test.jl integration
Expand Down
2 changes: 1 addition & 1 deletion src/analyzers/optanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ The [general configurations](@ref) and [the optimization analysis specific confi
can be specified as an optional argument.
"""
macro report_opt(ex0...)
return InteractiveUtils.gen_call_with_extracted_types_and_kwargs(__module__, :report_opt, ex0)
return gen_call_with_extracted_types_and_kwargs(__module__, :report_opt, ex0)
end

"""
Expand Down
4 changes: 2 additions & 2 deletions src/toplevel/virtualprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ end

const VIRTUAL_MODULE_NAME = :JETVirtualModule

gen_virtual_module(root = Main; name = VIRTUAL_MODULE_NAME) =
Core.eval(root, :(module $(gensym(name)) end))::Module
gen_virtual_module(parent::Module = Main; name = VIRTUAL_MODULE_NAME) =
Core.eval(parent, :(module $(gensym(name)) end))::Module

# NOTE when `@generated` function has been defined, signatures of both its entry and
# generator should have been collected, and we will just analyze them separately
Expand Down

0 comments on commit 714f0ff

Please sign in to comment.