From: Arthur Cohen Date: Tue, 25 Oct 2022 08:48:43 +0000 (+0200) Subject: gccrs: intrinsics: Add `sorry_handler` intrinsic handler X-Git-Tag: basepoints/gcc-14~996 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=782e070374acd7e20a883958d5e0c30f2b032338;p=thirdparty%2Fgcc.git gccrs: intrinsics: Add `sorry_handler` intrinsic handler gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc (sorry_handler): New intrinsic handler. gcc/testsuite/ChangeLog: * rust/compile/torture/intrinsics-3.rs: New test. --- diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index a418b863210f..2a2091ccc257 100644 --- a/gcc/rust/backend/rust-compile-intrinsic.cc +++ b/gcc/rust/backend/rust-compile-intrinsic.cc @@ -93,6 +93,15 @@ prefetch_write_data (Context *ctx, TyTy::FnType *fntype) return prefetch_data_handler (ctx, fntype, Prefetch::Write); } +static inline tree +sorry_handler (Context *ctx, TyTy::FnType *fntype) +{ + rust_sorry_at (fntype->get_locus (), "intrinsic %qs is not yet implemented", + fntype->get_identifier ().c_str ()); + + return error_mark_node; +} + static const std::map> generic_intrinsics = { @@ -107,6 +116,7 @@ static const std::map