Skip to content

Commit

Permalink
Add cross-references between codeview functions/macros (#51349)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd authored and NHDaly committed Sep 20, 2023
1 parent 0f7987d commit b4b7dbc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion stdlib/InteractiveUtils/src/codeview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Small unions of concrete types are usually not a concern, so these are highlight
Keyword argument `debuginfo` may be one of `:source` or `:none` (default), to specify the verbosity of code comments.
See [`@code_warntype`](@ref man-code-warntype) for more information.
See also: [`@code_warntype`](@ref), [`code_typed`](@ref), [`code_lowered`](@ref), [`code_llvm`](@ref), [`code_native`](@ref).
"""
function code_warntype(io::IO, @nospecialize(f), @nospecialize(t=Base.default_tt(f));
debuginfo::Symbol=:default, optimize::Bool=false, kwargs...)
Expand Down Expand Up @@ -273,6 +275,8 @@ If the `optimize` keyword is unset, the code will be shown before LLVM optimizat
All metadata and dbg.* calls are removed from the printed bitcode. For the full IR, set the `raw` keyword to true.
To dump the entire module that encapsulates the function (with declarations), set the `dump_module` keyword to true.
Keyword argument `debuginfo` may be one of source (default) or none, to specify the verbosity of code comments.
See also: [`@code_llvm`](@ref), [`code_warntype`](@ref), [`code_typed`](@ref), [`code_lowered`](@ref), [`code_native`](@ref).
"""
function code_llvm(io::IO, @nospecialize(f), @nospecialize(types=Base.default_tt(f));
raw::Bool=false, dump_module::Bool=false, optimize::Bool=true, debuginfo::Symbol=:default,
Expand All @@ -298,7 +302,7 @@ generic function and type signature to `io`.
* If `dump_module` is `false`, do not print metadata such as rodata or directives.
* If `raw` is `false`, uninteresting instructions (like the safepoint function prologue) are elided.
See also: [`@code_native`](@ref), [`code_llvm`](@ref), [`code_typed`](@ref) and [`code_lowered`](@ref)
See also: [`@code_native`](@ref), [`code_warntype`](@ref), [`code_typed`](@ref), [`code_lowered`](@ref), [`code_llvm`](@ref).
"""
function code_native(io::IO, @nospecialize(f), @nospecialize(types=Base.default_tt(f));
dump_module::Bool=true, syntax::Symbol=:intel, raw::Bool=false,
Expand Down
10 changes: 9 additions & 1 deletion stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ Evaluates the arguments to the function or macro call, determines their types, a
@code_typed optimize=true foo(x)
to control whether additional optimizations, such as inlining, are also applied.
See also: [`code_typed`](@ref), [`@code_warntype`](@ref), [`@code_lowered`](@ref), [`@code_llvm`](@ref), [`@code_native`](@ref).
"""
:@code_typed

Expand All @@ -305,6 +307,8 @@ to control whether additional optimizations, such as inlining, are also applied.
Evaluates the arguments to the function or macro call, determines their types, and calls
[`code_lowered`](@ref) on the resulting expression.
See also: [`code_lowered`](@ref), [`@code_warntype`](@ref), [`@code_typed`](@ref), [`@code_llvm`](@ref), [`@code_native`](@ref).
"""
:@code_lowered

Expand All @@ -313,6 +317,8 @@ Evaluates the arguments to the function or macro call, determines their types, a
Evaluates the arguments to the function or macro call, determines their types, and calls
[`code_warntype`](@ref) on the resulting expression.
See also: [`code_warntype`](@ref), [`@code_typed`](@ref), [`@code_lowered`](@ref), [`@code_llvm`](@ref), [`@code_native`](@ref).
"""
:@code_warntype

Expand All @@ -331,6 +337,8 @@ by putting them and their value before the function call, like this:
`raw` makes all metadata and dbg.* calls visible.
`debuginfo` may be one of `:source` (default) or `:none`, to specify the verbosity of code comments.
`dump_module` prints the entire module that encapsulates the function.
See also: [`code_llvm`](@ref), [`@code_warntype`](@ref), [`@code_typed`](@ref), [`@code_lowered`](@ref), [`@code_native`](@ref).
"""
:@code_llvm

Expand All @@ -350,7 +358,7 @@ by putting it before the function call, like this:
* If `binary` is `true`, also print the binary machine code for each instruction precedented by an abbreviated address.
* If `dump_module` is `false`, do not print metadata such as rodata or directives.
See also: [`code_native`](@ref), [`@code_llvm`](@ref), [`@code_typed`](@ref) and [`@code_lowered`](@ref)
See also: [`code_native`](@ref), [`@code_warntype`](@ref), [`@code_typed`](@ref), [`@code_lowered`](@ref), [`@code_llvm`](@ref).
"""
:@code_native

Expand Down

0 comments on commit b4b7dbc

Please sign in to comment.