diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-03-09 14:37:47 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-03-10 11:40:02 +0000 |
commit | a08ac0c27aed0c6d390d03656b708eb71381a5e9 (patch) | |
tree | 2de46126aaff38e8ef503952f299f164d6788f75 /gcc/rust/backend/rust-compile-fnparam.h | |
parent | 865b6090a8f8981cdfc050ea2ee44abbe92de141 (diff) | |
download | gcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.zip gcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.tar.gz gcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.tar.bz2 |
Add support for the rust offset intrinsic
This patch adds the initial support for generic intrinsics these are do not
map directly to GCC builtins and need to be substited with their specificed
types. This patch allows for custom implementation body for these functions
by specifying handler functions which will generate the applicable
intrinsic when asked for.
Addresses #658
Diffstat (limited to 'gcc/rust/backend/rust-compile-fnparam.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-fnparam.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-fnparam.h b/gcc/rust/backend/rust-compile-fnparam.h index 74df725..5e3cfaa 100644 --- a/gcc/rust/backend/rust-compile-fnparam.h +++ b/gcc/rust/backend/rust-compile-fnparam.h @@ -36,6 +36,14 @@ public: return compiler.compiled_param; } + static Bvariable *compile (Context *ctx, tree fndecl, HIR::Pattern *param, + tree decl_type, Location locus) + { + CompileFnParam compiler (ctx, fndecl, decl_type, locus); + param->accept_vis (compiler); + return compiler.compiled_param; + } + void visit (HIR::IdentifierPattern &pattern) override { if (!pattern.is_mut ()) |