@@ -1174,13 +1174,39 @@ function func_for_method_checked(m::Method, @nospecialize(types), sparams::Simpl
11741174end
11751175
11761176"""
1177- code_typed(f, types; optimize=true, debuginfo=:default )
1177+ code_typed(f, types; kw... )
11781178
11791179Returns an array of type-inferred lowered form (IR) for the methods matching the given
1180- generic function and type signature. The keyword argument `optimize` controls whether
1181- additional optimizations, such as inlining, are also applied.
1182- The keyword `debuginfo` controls the amount of code metadata present in the output,
1180+ generic function and type signature.
1181+
1182+ # Keyword Arguments
1183+
1184+ - `optimize=true`: controls whether additional optimizations, such as inlining, are also applied.
1185+ - `debuginfo=:default`: controls the amount of code metadata present in the output,
11831186possible options are `:source` or `:none`.
1187+
1188+ # Internal Keyword Arguments
1189+
1190+ This section should be considered internal, and is only for who understands Julia compiler
1191+ internals.
1192+
1193+ - `world=Base.get_world_counter()`: optional, controls the world age to use when looking up methods,
1194+ use current world age if not specified.
1195+ - `interp=Core.Compiler.NativeInterpreter(world)`: optional, controls the interpreter to use,
1196+ use the native interpreter Julia uses if not specified.
1197+
1198+ # Example
1199+
1200+ One can put the argument types in a tuple to get the corresponding `code_typed`.
1201+
1202+ ```julia
1203+ julia> code_typed(+, (Float64, Float64))
1204+ 1-element Vector{Any}:
1205+ CodeInfo(
1206+ 1 ─ %1 = Base.add_float(x, y)::Float64
1207+ └── return %1
1208+ ) => Float64
1209+ ```
11841210"""
11851211function code_typed (@nospecialize (f), @nospecialize (types= default_tt (f));
11861212 optimize= true ,
0 commit comments