From 83e5265d6af48e1572cbe019b4b7f7a5603086a9 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 25 Oct 2022 10:48:43 +0200 Subject: intrinsics: Add `sorry_handler` intrinsic handler This allows us to define intrinsics without implementing their body. This will be useful for atomic intrinsics for example, as there are a lot of them and we should work on implementing them one by one properly and slowly --- gcc/rust/backend/rust-compile-intrinsic.cc | 10 ++++++++++ gcc/testsuite/rust/compile/torture/intrinsics-3.rs | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/rust/compile/torture/intrinsics-3.rs (limited to 'gcc') diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc index a418b86..2a2091c 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