use load_literal

This commit is contained in:
satotake 2021-11-23 10:09:53 +00:00 committed by GitHub
parent 0085272cb8
commit 4376db6c17
2 changed files with 7 additions and 2 deletions

View file

@ -491,9 +491,11 @@ where
debug_assert_eq!(
Layout::Builtin(Builtin::Bool),
*ret_layout,
"NumIsZero: expected to have return layout of type I1"
"NumIsZero: expected to have return layout of type Bool"
);
self.build_num_is_zero(sym, &args[0], &arg_layouts[0])
self.load_literal(&Symbol::DEV_TMP, &Literal::Int(0))?;
self.build_eq(sym, &args[0], &Symbol::DEV_TMP, &arg_layouts[0])
}
_ => Err(format!(
"the function, {:?}, is not yet implemented",

View file

@ -880,6 +880,9 @@ define_builtins! {
// the _ used in mono when a specialized symbol is deleted
25 REMOVED_SPECIALIZATION: "#removed_specialization"
// used in dev backend
26 DEV_TMP: "#dev_tmp"
}
1 NUM: "Num" => {
0 NUM_NUM: "Num" imported // the Num.Num type alias