Skip to content

Commit 4b23662

Browse files
committed
Support rewriting a store referring to a function.
1 parent c8d3c49 commit 4b23662

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/irgen.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,12 @@ function add_kernel_state!(mod::LLVM.Module)
713713
elseif val isa LLVM.CallBase
714714
# the function is being passed as an argument, which we'll just permit,
715715
# because we expect to have rewritten the call down the line separately.
716+
elseif val isa LLVM.StoreInst
717+
# the function is being stored, which again we'll permit like before.
716718
elseif val isa ConstantExpr
717719
rewrite_uses!(val)
718720
else
719-
error("Cannot rewrite unknown use of function: $val")
721+
error("Cannot rewrite $(typeof(val)) use of function: $val")
720722
end
721723
end
722724
end

0 commit comments

Comments
 (0)