Skip to content

Commit

Permalink
Updated rustc version + misc fixes to intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
FractalFir committed Aug 8, 2024
1 parent 728c4ba commit 44028c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,9 @@ impl ArchiveBuilderBuilder for RlibArchiveBuilder {
&self,
_sess: &Session,
_lib_name: &str,
_dll_imports: &[rustc_session::cstore::DllImport],
_dll_imports: std::vec::Vec<(std::string::String, std::option::Option<u16>)>,
_tmpdir: &Path,
_is_direct_dependency: bool,
) -> PathBuf {
) {
unimplemented!("creating dll imports is not supported");
}
}
Expand Down
18 changes: 18 additions & 0 deletions src/terminator/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,24 @@ fn intrinsic_slow<'tcx>(
crate::constant::load_const_value(const_val, Ty::new_static_str(ctx.tcx()), ctx),
ctx,
)
} else if fn_name.contains("select_unpredictable") {
let select_ty = ctx.monomorphize(
call_instance.args[0]
.as_type()
.expect("needs_drop works only on types!"),
);
let select_ty = ctx.monomorphize(select_ty);
let select_ty = ctx.type_from_cache(select_ty);
place_set(
destination,
CILNode::select(
select_ty,
handle_operand(&args[1].node, ctx),
handle_operand(&args[2].node, ctx),
handle_operand(&args[0].node, ctx),
),
ctx,
)
} else {
todo!("Unhandled intrinsic {fn_name}.")
}
Expand Down

0 comments on commit 44028c1

Please sign in to comment.