You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can probably be done with a specific pass but I wonder if there is a simpler way to "tag" the calls to overdub so I can related them back to the original code of the overdubbed method?
One way to illustrate this is that for a function like:
functionf(x, y)
if x < y # line 1return x + y # line 2 else
a = x + y # line 4return a
endend
I would want a way to discriminate between the Cassette.overdub(ctx, :+, :x, :y) call on "line" 2 and the same call on "line" 4. So essentially something like a Cassette.overdub(context::Context, n::Int, f, args...) where n is unique Int for each unique call site of the overdubbed code.
What I'm trying to achieve here is a simple expression coverage calculation and even though the calls have the same arguments and returns the same result the calls correspond to different "call sites" so for some applications (like mine) we need to keep them apart.
Any ideas how to easily achieve this? Or have you seen anyone implementing a code/expression coverage tool using Cassette? Thanks in advance for any pointers/insight.
The text was updated successfully, but these errors were encountered:
@robertfeldt did you find an answer to your question? I suspect one could do this with a pass, where you insert before each call a push!(ctx, (f, args...), LineInfo). The question is how do you do "differentiation". If you just need a trace you can do that with prehook/posthook.
This can probably be done with a specific pass but I wonder if there is a simpler way to "tag" the calls to overdub so I can related them back to the original code of the overdubbed method?
One way to illustrate this is that for a function like:
I would want a way to discriminate between the
Cassette.overdub(ctx, :+, :x, :y)
call on "line" 2 and the same call on "line" 4. So essentially something like aCassette.overdub(context::Context, n::Int, f, args...)
where n is unique Int for each unique call site of the overdubbed code.What I'm trying to achieve here is a simple expression coverage calculation and even though the calls have the same arguments and returns the same result the calls correspond to different "call sites" so for some applications (like mine) we need to keep them apart.
Any ideas how to easily achieve this? Or have you seen anyone implementing a code/expression coverage tool using Cassette? Thanks in advance for any pointers/insight.
The text was updated successfully, but these errors were encountered: