Skip to content

Commit

Permalink
In --print-ir, explicitly show CallStatic and CallDyn (#539)
Browse files Browse the repository at this point in the history
Previously, --print-ir didn't distinguish between CallStatic and CallDyn

    x2 <- f(x1)

Now it shows which one it is.

    x2 <- CallStatic f(x1)
    x2 <- CallDyn g(x1)
  • Loading branch information
hugomg authored May 24, 2022
1 parent 1ff5f4f commit f69e751
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pallene/print_ir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ local function Cmd(cmd)
elseif tag == "ir.Cmd.SetField" then rhs = Val(cmd.src_v)
elseif tag == "ir.Cmd.NewClosure" then rhs = Call("NewClosure", { Fun(cmd.f_id) })
elseif tag == "ir.Cmd.InitUpvalues" then rhs = comma_concat(Vals(cmd.srcs))
elseif tag == "ir.Cmd.CallStatic" then rhs = Call(Val(cmd.src_f), Vals(cmd.srcs))
elseif tag == "ir.Cmd.CallDyn" then rhs = Call(Val(cmd.src_f), Vals(cmd.srcs))
elseif tag == "ir.Cmd.CallStatic" then
rhs = "CallStatic ".. Call(Val(cmd.src_f), Vals(cmd.srcs))
elseif tag == "ir.Cmd.CallDyn" then
rhs = "CallDyn ".. Call(Val(cmd.src_f), Vals(cmd.srcs))
else
local tagname = assert(typedecl.match_tag(cmd._tag, "ir.Cmd"))
rhs = Call(tagname, Vals(ir.get_srcs(cmd)))
Expand Down

0 comments on commit f69e751

Please sign in to comment.