Skip to content

Commit 06477d1

Browse files
author
KDr2
committed
isimplify trace_into
1 parent b7527ef commit 06477d1

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/tapedfunction.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,11 @@ function run(tape::Tape, args...)
101101
end
102102

103103
# if we should trace into a function
104-
NEVER_TRACING_MODULES = [@__MODULE__, Base, Core]
105-
TRACING_MODULES = Set()
104+
# TODO:
105+
# overload (instr::Instruction{F})() to specify
106+
# which function to trace into
106107
function trace_into end
107108
trace_into(x) = false
108-
trace_into(m::Vararg{Module, N}) where N = push!(TRACING_MODULES, m...)
109-
function trace_into(f::Function)
110-
mods = map(x->x.module, methods(f))
111-
dont_trace = any(mods) do m
112-
m in NEVER_TRACING_MODULES
113-
end
114-
dont_trace && return false
115-
any(mods) do m
116-
m in TRACING_MODULES
117-
end
118-
end
119109

120110
function run_and_record!(tape::Tape, f, args...)
121111
f = val(f) # f maybe a Boxed closure

0 commit comments

Comments
 (0)