Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "LoweredCodeUtils"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
authors = ["Tim Holy <[email protected]>"]
version = "3.2.0"
version = "3.2.1"

[deps]
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"

[compat]
JuliaInterpreter = "0.9"
JuliaInterpreter = "0.9.44"
julia = "1.10"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/LoweredCodeUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module LoweredCodeUtils

using JuliaInterpreter
using JuliaInterpreter: SSAValue, SlotNumber, Frame
using JuliaInterpreter: @lookup, moduleof, pc_expr, step_expr!, is_global_ref, is_quotenode_egal, whichtt,
using JuliaInterpreter: @lookup, moduleof, pc_expr, step_expr!, is_global_ref, is_global_ref_egal, is_quotenode_egal, whichtt,
next_until!, finish_and_return!, get_return, nstatements, codelocation, linetable,
is_return, lookup_return

Expand Down
9 changes: 8 additions & 1 deletion src/codeedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,21 @@ function namedkeys(cl::CodeLinks)
return ukeys
end

# Required by Revise, but otherwise deprecated
# The depwarn is currently disabled because Revise's tests check for empty warning logs
function is_assignment_like(@nospecialize stmt)
# Base.depwarn("is_assignment_like is deprecated, switch to `LoweredCodeUtils.get_lhs_rhs`", :is_assignment_like)
return isexpr(stmt, :(=)) || isexpr(stmt, :const, 2)
end

function get_lhs_rhs(@nospecialize stmt)
if isexpr(stmt, :(=))
return Pair{Any,Any}(stmt.args[1], stmt.args[2])
elseif isexpr(stmt, :const) && length(stmt.args) == 2
return Pair{Any,Any}(stmt.args[1], stmt.args[2])
elseif isexpr(stmt, :call) && length(stmt.args) == 4
f = stmt.args[1]
if isa(f, GlobalRef) && f.name === :setglobal!
if is_global_ref_egal(f, :setglobal!, Core.setglobal!)
mod = stmt.args[2]
mod isa Module || return nothing
name = stmt.args[3]
Expand Down
6 changes: 5 additions & 1 deletion src/packagedef.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Base.Experimental.@optlevel 1

using Core: SimpleVector
using Core.IR
using Core.IR: CodeInfo, GotoIfNot, GotoNode, IR, MethodInstance, ReturnNode
@static if isdefined(Core.IR, :EnterNode)
using Core.IR: EnterNode
end
using Core.Compiler: construct_domtree, construct_postdomtree, nearest_common_dominator,
postdominates
using Base.Meta: isexpr

const SSAValues = Union{Core.Compiler.SSAValue, JuliaInterpreter.SSAValue}

const trackedheads = (:method,) # Revise uses this (for now), don't delete; also update test/hastrackedexpr if this list gets expanded
const structdecls = (:_structtype, :_abstracttype, :_primitivetype)

export signature, rename_framemethods!, methoddef!, methoddefs!, bodymethod
Expand Down
Loading