diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-10-25 10:48:43 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-02-21 12:36:42 +0100 |
commit | 782e070374acd7e20a883958d5e0c30f2b032338 (patch) | |
tree | b8079471a8ed403c44ecc867fef38493a1355e6d /gcc/rust/backend/rust-compile-intrinsic.cc | |
parent | 4d39d3912ffeec47134f46f705ed48a248df226c (diff) | |
download | gcc-782e070374acd7e20a883958d5e0c30f2b032338.zip gcc-782e070374acd7e20a883958d5e0c30f2b032338.tar.gz gcc-782e070374acd7e20a883958d5e0c30f2b032338.tar.bz2 |
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.
Diffstat (limited to 'gcc/rust/backend/rust-compile-intrinsic.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-intrinsic.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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<std::string, std::function<tree (Context *, TyTy::FnType *)>> generic_intrinsics = { @@ -107,6 +116,7 @@ static const std::map<std::string, {"copy_nonoverlapping", ©_nonoverlapping_handler}, {"prefetch_read_data", &prefetch_read_data}, {"prefetch_write_data", &prefetch_write_data}, + {"atomic_load", &sorry_handler}, }; Intrinsics::Intrinsics (Context *ctx) : ctx (ctx) {} |