Skip to content

Commit 22a5de6

Browse files
committed
fix intrinsic
1 parent 634adfb commit 22a5de6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/intrinsic.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@ function intrinsic_stub_m(mod::Module, ctxname::Symbol, ex::Expr)
2222
end
2323
)
2424

25-
isintrinsic_def = isdefined(mod, :isintrinsic) ? nothing :
26-
:(isintrinsic(x) = false)
25+
isintrinsic_def = if isdefined(mod, :__INTRINSICS__)
26+
nothing
27+
else
28+
quote
29+
const __INTRINSICS__ = Set{Any}()
30+
isintrinsic(x) = x in __INTRINSICS__
31+
end
32+
end
33+
2734
quote
2835
$isintrinsic_def
2936
@noinline $(codegen_ast(jlfn))
30-
isintrinsic(::typeof($(jlfn.name))) = true
37+
push!(__INTRINSICS__, $(jlfn.name))
3138
end
3239
end

0 commit comments

Comments
 (0)