|
120 | 120 |
|
121 | 121 | # Convert SyntaxTree to the CodeInfo+Expr data stuctures understood by the |
122 | 122 | # Julia runtime |
123 | | -function to_code_info(ex, mod, funcname, slots) |
124 | | - input_code = children(ex) |
| 123 | +function to_code_info(ex::SyntaxTree, mod::Module, slots::Vector{Slot}) |
125 | 124 | stmts = Any[] |
126 | 125 |
|
127 | 126 | current_codelocs_stack = ir_debug_info_state(ex) |
@@ -223,11 +222,11 @@ function to_code_info(ex, mod, funcname, slots) |
223 | 222 | ) |
224 | 223 | end |
225 | 224 |
|
226 | | -@fzone "JL: to_lowered_expr" function to_lowered_expr(mod, ex) |
| 225 | +@fzone "JL: to_lowered_expr" function to_lowered_expr(mod::Module, ex::SyntaxTree) |
227 | 226 | _to_lowered_expr(mod, ex, 0) |
228 | 227 | end |
229 | 228 |
|
230 | | -function _to_lowered_expr(mod, ex, stmt_offset) |
| 229 | +function _to_lowered_expr(mod::Module, ex::SyntaxTree, stmt_offset::Int) |
231 | 230 | k = kind(ex) |
232 | 231 | if is_literal(k) |
233 | 232 | ex.value |
@@ -268,10 +267,7 @@ function _to_lowered_expr(mod, ex, stmt_offset) |
268 | 267 | e1 = ex[1] |
269 | 268 | getmeta(ex, :as_Expr, false) ? QuoteNode(Expr(e1)) : e1 |
270 | 269 | elseif k == K"code_info" |
271 | | - funcname = ex.is_toplevel_thunk ? |
272 | | - "top-level scope" : |
273 | | - "none" # FIXME |
274 | | - ir = to_code_info(ex[1], mod, funcname, ex.slots) |
| 270 | + ir = to_code_info(ex[1], mod, ex.slots) |
275 | 271 | if ex.is_toplevel_thunk |
276 | 272 | Expr(:thunk, ir) |
277 | 273 | else |
@@ -400,4 +396,3 @@ function include_string(mod::Module, code::AbstractString, filename::AbstractStr |
400 | 396 | expr_compat_mode=false) |
401 | 397 | eval(mod, parseall(SyntaxTree, code; filename=filename); expr_compat_mode) |
402 | 398 | end |
403 | | - |
0 commit comments