-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add @code_llvm
macro
#5779
Conversation
This allows you to do: ```julia In [74]: @code_llvm 1 + 1 define i64 @"julia_+672"(i64, i64) { top: %2 = add i64 %1, %0, !dbg !2075 ret i64 %2, !dbg !2075 } ``` Reference issue: #5674 I based this entirely after the implementation of `@which`, but it seems like it could be a bit cleaner. If we get some more thorough review here I can accordingly add the other code_ macros.
In general, I think it would be good to make all the function versions of these kinds of things take |
Also, this is lovely. |
I do like the idea of this, but this should clearly share code with |
Yeah, I had a drive tonight and realized we need a In terms of just showing the outermost function only, I guess my natural expectation was that it would indeed only show the outermost. In [79]: macroexpand(:(@code_llvm sin(cos(1))))
Out [79]: :(code_llvm(sin,(typeof(cos(1)),))) AKA what's the llvm for calling |
One option would be to show code for all of the function calls in the expression in some order, but that would probably be a lot of code. |
I didn't mean to supersede this, but I happened to stumble upon a solution that completely shares code with |
I would love to be proven wrong, but I do not think it is possible to present the information Jeff wants in a way that would be intuitive in a terminal interface. I think it would be a job for Julia Studio, iJulia and Julietta to rewrite these macros to be more useful in their rich environments. The documentation @mbauman wrote, says very clear that only the outer function is considered. |
Subsumed by #5832. |
This allows you to do:
Reference issue: #5674
I based this entirely after the implementation of
@which
, but it seems like it could be a bit cleaner. If we get some more thorough review here I can accordingly add the other code_ macros.