Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "Tape based task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.6.4"
version = "0.6.5"

[deps]
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
Expand Down
3 changes: 3 additions & 0 deletions src/tapedfunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end
val(x) = x
val(x::Box) = x.val
val(x::TapedFunction) = x.func
val(x::GlobalRef) = getproperty(x.mod, x.name)
box(x) = Box(x)
box(x::Box) = x
Base.show(io::IO, box::Box) = print(io, "Box(", box.val, ")")
Expand Down Expand Up @@ -247,6 +248,8 @@ function intercept(ir; recorder=:track!)
elseif Meta.isexpr(st.expr, :new)
args = st.expr.args
ir[x] = IRTools.xcall(@__MODULE__, recorder, tape, _new, args...)
elseif isa(st.expr, GlobalRef)
ir[x] = IRTools.xcall(@__MODULE__, recorder, tape, val, st.expr)
else
@warn "Unknown IR code: " st
end
Expand Down