My tracing package currently parses files to recover the AST behind every traced function. It works, but it’s slow. Perhaps working with lowered code would be better. I’ve read the devdocs and still have a few questions. Any help greatly appreciated!
- I can get the lowered code for
foo(::Int)
withBase.uncompressed_ast
. How do I changefoo(::Int)
's definition with my new lowered code? That is, what’s the correct way to writeeval(:(function foo() $new_lowered_code end))
? - Keyword argument functions are lowered into three methods. I can trace both the
kwfunc(fun)
andfun
, or the function with the actual code. The latter sounds simpler. Is there a function likekwfunc
to get it? -
f(x, a=2) = x+a
defines two methods, but I don’t want to trace both. How can I identify that thef(x)
method is a forwarding function? - I can get most of the functions defined in module M from
names(M, true, true)
, but if M defineBase.convert(...) = ...
without importingconvert
, it won’t be part ofnames
. How can I find all such methods defined inM
?
Thank you!