Skip to content

Commit

Permalink
use Charms.Intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalcooper committed Oct 6, 2024
1 parent 290f88d commit e7c0521
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/charms/env.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Charms.Env do
use Beaver
use Charms.Intrinsic

@impl true
def handle_intrinsic(:t, [], opts) do
Beaver.ENIF.Type.env(opts)
end
Expand Down
3 changes: 2 additions & 1 deletion lib/charms/prelude.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Charms.Prelude do
use Beaver
use Charms.Intrinsic
alias Beaver.MLIR.Dialect.{Arith, Func}
@enif_functions Beaver.ENIF.functions()
@binary_ops [:!=, :-, :+, :<, :>, :<=, :>=, :==, :&&, :*]
Expand Down Expand Up @@ -31,6 +31,7 @@ defmodule Charms.Prelude do
v
end

@impl true
def handle_intrinsic(:result_at, [%MLIR.Value{} = v, i], _opts) when is_integer(i) do
v
end
Expand Down
3 changes: 2 additions & 1 deletion lib/charms/term.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Charms.Term do
use Beaver
use Charms.Intrinsic

@impl true
def handle_intrinsic(:t, [], opts) do
Beaver.ENIF.Type.term(opts)
end
Expand Down

0 comments on commit e7c0521

Please sign in to comment.